Re: Submitting data to HTTPS javascript
- From: Laszlo Nagy <gandalf@xxxxxxxxxxxx>
- Date: Wed, 14 May 2008 22:36:07 +0200
John Chandler wrote:
I am trying to write a script to test certain functionality of a website that requires users to login. The login page is simple, a few pictures and two text bars (one for username and one for password). I tried logging in with webbrowser, but that did not work because the page uses javascript. I also tried using win32com though I have no idea what I am doing. Any ideas?- Use firefox :-)
- Install "LiveHTTPHeaders" http://livehttpheaders.mozdev.org/
- Open the plugin in one window and the website in another
- Enable "capture" in livehttpheaders (default)
- Login to the website
- Disable "capture" in livehttpheaders (default)
- Check the GET and POST requests in the capture log
- Try to send the same GET and POST requests from Python.
- Don't forget that most sites will also need cookies - you have to extract and send back cookies as needed
You do not need any GUI component for this job.
Other good things to have:
- Good knowledge of the "re" standard module, and regular expression syntax
- BeautifulSoup (especially ICanBelieveItIsBeautifulSoup...)
You might also check the "mechanoid" project. (I have never used it but it is said to be an automatized, controllable web browser???)
If anyone is interested, I can put up a python recipe that shows how to emulate a browser easily.
Best,
Laszlo
.
- Prev by Date: Re: Class Methods Vs Any Other Callable
- Next by Date: Re: wxpython dialog - do something after ShowModal()?
- Previous by thread: Using file objects with elementtree
- Next by thread: sys.excepthack...
- Index(es):
Relevant Pages
|