HTML expect in python

W

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)"
)
 
D

D H

WGW said:
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.
 
T

tertius

WGW said:
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/
 
W

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,201
Latest member
KourtneyBe

Latest Threads

Top