html + javascript automations = [mechanize + ?? ] or somethingelse?

Duncan Booth duncan.booth at invalid.invalid
Mon Jan 22 03:47:44 EST 2007


"John" <weekender_ny at yahoo.com> wrote:

> I tried it, didnt work with the python25 distribution msi file that is
> on python.org
> But activestate python worked. Now I can open IE using COM. What I am
> trying
> to figure out is how to click an x,y coordinate on a page in IE
> automatically
> using COM. How about typing something automatically...Any ideas?

Don't think about clicking a coordinate or typing something; think about 
the actions on the page. e.g. to fill in a field on a form you'll want 
something like:

    	ie.document.forms[formname][fieldname].value = 'whatever'

to click a button call its click method e.g.

   submit = ie.document.forms[0]['submit']
   submit.focus()
   submit.click()

Check out the documentation at msdn.microsoft.com for the application, 
document, form etc. objects. Generally speaking anything you could have 
done through javascript you should be able to do through automation, plus a 
few of other things that javascript might have blocked for security 
reasons.




More information about the Python-list mailing list