473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

webbrowser controls, javascript, Python [could use win32com]

Help!

I have this project where the program should paste an item on a certain website's textarea and then it would be the one to click on submit so that the value of that item be returned.

How can i manipulate javascript through Python? How can I make it paste an item then click the submit button?

Is there anyone who can help me?? unsure.gif

Thanks!
Oct 23 '06 #1
5 2492
bartonc
6,596 Expert 4TB
Have you looked in Jython yet?
Oct 23 '06 #2
kudos
127 Expert 100+
Help!

I have this project where the program should paste an item on a certain website's textarea and then it would be the one to click on submit so that the value of that item be returned.

How can i manipulate javascript through Python? How can I make it paste an item then click the submit button?

Is there anyone who can help me?? unsure.gif

Thanks!
even though your problem doesn't seem to be very well formulated (for instance, what is an "item") couldn't you do something like this? (without using python at all)


Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3. <body>
  4. <script type="text/javascript">
  5.  
  6. function foo(){
  7. alert(document.test.me.value)
  8. }
  9.  
  10. </script>
  11.  
  12.  
  13. <form name="test">
  14. <textarea name="me"></textarea>
  15. <input type="button" onClick="foo()">
  16. </form>
  17. </body>
  18. </html>
  19.  
  20.  
  21.  
Will make a bip, and display an alert box with the content of the textarea.
Oct 23 '06 #3
bartonc: No, I haven't looked into Jython yet. It's an integration of Java and Python, right? We are required to do it in Python alone..

kudos:
even though your problem doesn't seem to be very well formulated (for instance, what is an "item") couldn't you do something like this? (without using python at all)


Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3. <body>
  4. <script type="text/javascript">
  5.  
  6. function foo(){
  7. alert(document.test.me.value)
  8. }
  9.  
  10. </script>
  11.  
  12.  
  13. <form name="test">
  14. <textarea name="me"></textarea>
  15. <input type="button" onClick="foo()">
  16. </form>
  17. </body>
  18. </html>
  19.  
  20.  
  21.  
Will make a bip, and display an alert box with the content of the textarea.
The program that I'm doing is in Python. Manually, one would be pasting certain texts in a textarea of a website, click submit, the page then would be redirected to the result, then copy and paste the result to an xml document. We were asked to automate this process. The website that I am referring to is in javascript so I figured the python program can manipulate its source. I looked into the webbrowser module but all I can do was open the url of the said website (i.e. webbrowser.open(url)). I'm relatively new to Python so if anyone can help me, I'd be very grateful =)
Oct 23 '06 #4
fuffens
38
There are many tools (free and commercial) to record gui operations as macros. But if you insisit on using Python I would suggest to call COM functions for Internet Explorer to access text areas and submit buttons. The module win32com is installed when you install PythonWin. It is used for COM operations.

/Fredrik
Oct 28 '06 #5
bartonc
6,596 Expert 4TB
There are many tools (free and commercial) to record gui operations as macros. But if you insisit on using Python I would suggest to call COM functions for Internet Explorer to access text areas and submit buttons. The module win32com is installed when you install PythonWin. It is used for COM operations.

/Fredrik
Thanks, Fredrik.
It's obvious that this is the python on windows forum. I'm sure that we all benefit from reminders of the usefulness of win32all extentions. Honestly, I forget that they are there for every-day use. I tend to turn to them when nothing else will do the trick (like serial port access).
Keep it up,
Barton
Oct 28 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
4
by: MK | last post by:
I'm working with IIS on W2K server. I'm trying to use module "wmi" in a CGI script but with no success. The following works: import cgitb; cgitb.enable() cgi.test() .... but the...
9
by: DD | last post by:
Hello, Could anyone please help me?? Is there somebody who could explain me how to make a connection to a access database with a python cgi script. I would like to use common sql commands in my...
1
by: Florian Fredegar Haftmann | last post by:
Hi! I'm working on a tool which helps in testing applications with web-frontends (on Windows) On thing I would like to test ist the occurence of JavaScript errors; the idea is that the test...
5
by: export | last post by:
Does anyone know how to lanch a webbrowser ( from Python) without menu and toolbars? Thanks for help Lad
8
by: Joakim Persson | last post by:
Hello all. I am involved in a project where we have a desire to improve our software testing tools, and I'm in charge of looking for solutions regarding the logging of our software (originating...
1
by: DD | last post by:
Hello, Could anyone please help me?? Is there somebody who could explain me how to make a connection to a access database with a python cgi script. I would like to use common sql commands in my...
9
by: ASP .NET Newbie | last post by:
How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can use the WebClient to get the page data, but I need to be able to use the WebBrowser (AxWebBrowser)? Thanks, Chad
1
by: zdp | last post by:
Hi, all, My project is based on wxPython, and I need an IE control (i.e. WebBrowser ActiveX control). Although the wxPython implements a wrapped version (wx.lib.iewin.IEHtmlWindow), but it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.