Created
July 1, 2013 00:06
-
-
Save whiteclover/5897574 to your computer and use it in GitHub Desktop.
get form from web page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mechanize | |
import sys | |
br = mechanize.Browser() | |
response = br.open(sys.argv[1]) | |
for form in br.forms(): | |
print "name:[%r] id:[%r] action:[%s]" %(form.name, form.attrs.get('id'), form.action) | |
print "Controls: " | |
for control in form.controls: | |
print ' ', control.type, control.name, repr(control.value) | |
print(" ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment