473,506 Members | 16,954 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML expect in python

WGW
I would like to automate some simple browser navigating using python.
Ideally, I would like a package like pyexpect, but that can handle a
browser in much the same way as pyexpect handles a terminal (tall
order!). In short, I want a macro language for a browser (I know about
the commercial packages such as Easy Bee and Internet macros, but I want
more programmability and less cost!)

ClientForms goes in the right direction. Can Grail be scripted (easily)?

What is the best way to run a browser with python? Python would have to
be able to fill in forms, send them off, click links, and so on. I don't
really care which browser it is.

Apparently, commandline python scripts can control IE.

Not sure where to find examples....

Any suggestions?
(I found the following remark:

A different flavor of client-side Python scripting is that Mark
Hammond's [ref] hard work has made possible. Internet Explorer (and WSH
[give ref]) support(s) ActiveScripting [ref] languages, including
Python. Thus, as Gilles Lenfant enumerated in private correspondence:

* Command-line Python scripts control IE (but equally well through
COM [ref]);
* Client-side scripts interpret Python embedded in HTML as well as
they do JavaScript [ref];

* "you can write 'hta' applications with full-featured Python (use
of IE5 for GUI)"
)
Jul 21 '05 #1
4 1723
D H
WGW wrote:
I would like to automate some simple browser navigating using python.
Ideally, I would like a package like pyexpect, but that can handle a
browser in much the same way as pyexpect handles a terminal (tall
order!). In short, I want a macro language for a browser (I know about
the commercial packages such as Easy Bee and Internet macros, but I want
more programmability and less cost!)


See the mechanize module: http://wwwsearch.sourceforge.net/mechanize/
Or else you can use win32com stuff to automate internet explorer if you
really need to do it that way.
Jul 21 '05 #2
WGW wrote:
I would like to automate some simple browser navigating using python.
Ideally, I would like a package like pyexpect, but that can handle a
browser in much the same way as pyexpect handles a terminal (tall
order!). In short, I want a macro language for a browser (I know about
the commercial packages such as Easy Bee and Internet macros, but I want
more programmability and less cost!)


http://pamie.sourceforge.net/
Jul 21 '05 #3
D H wrote:
See the mechanize module: http://wwwsearch.sourceforge.net/mechanize/


I second this, a very useful module. I've unfortunately had to change it
a little to deal with inevitably bad HTML supplied by web sites.
--
Michael Hoffman
Jul 21 '05 #4
WGW
Thanks for these replies -- looks like I have all I need; now it is just
a question of getting my head around the applications and doing some
testing...

Many thanks for pointers.
Jul 21 '05 #5

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

Similar topics

9
3102
by: Jeff Wagner | last post by:
Is there an Expect-like module for Python that is cross platform and, for the most part, does what Expect does? A number of years ago, I wrote some Tcl scripts using Expect for automation. I am...
4
3533
by: David Stockwell | last post by:
Hi, In java/jsp I can pass parameters to my python script on a webpage by doing something like this: http://somewhere.org/mypage.jsp?parm1=something&parm2=another How do I do that with...
5
3398
by: xinchenvn | last post by:
Hi I'm learning Python. I don't know whether Python can do something like Expect can do. If yes, please show me how to do it. I want to do something automatically: open connection to a ftp...
16
2857
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the...
0
7218
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
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7370
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...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.