Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

IE Automation in Python (See related posts)

I try to dump my data out of a website. But it block my python's urllib bot. I tried other pure python libray but without success. So, I try a quicker route using IE automation.
For general automation you should try 'watsup'. For IE, there is PAMIE.
>>> from cPAMIE import PAMIE
>>> ie = PAMIE()
>>> ie.Navigate('www.google.com')   # go to google
>>> ie.SetTextBox('Python','q',0)       # search for python
>>> ie.ClickButton('btnG')               # Go!

>>> src = ie.pageText()                 # here it is
>>> cookie = ie.GetCookie()          # Ok, cookie is yummy


PAMIE is actually aimed for more of the testing work.
But in this case it serves me fine.
http://pamie.sourceforge.net/

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts