Question

I am learning web-scraping with python-mechanize. At the moment, to enter a secure site, I have been entering data into forms manually then submitting. Like this:

br.open("www.example.org/login.hmtl")
br.select_form(nr=0)
br['uname'] = "USERNAME"
br['pword'] = "PASSWORD"
br.submit()

I assume that under the hood, this is being sent to the server as a 'GET' or 'POST' request and the information I type in is encoded in a url. Is there a way for me to find out what the format of this url is so that I can encode the information myself? I am using chrome, it would be great to be able to somehow identify the structure of a form's submit request.

Was it helpful?

Solution

you can enable logging in mechanize. for a tutorial see http://wwwsearch.sourceforge.net/mechanize/hints.html#logging

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top