Open ronin1770 opened 4 years ago
You will need to provide a minimal example where this fails.
browser = mechanize.Browser(history=None)
browser.open(LOGIN_URL)
browser.select_form(nr = 0)
browser.form['username'] = UID
browser.form['userpass'] = PWD
resp = browser.submit()
security_url = resp.geturl()
print( "The security url is: " + str(security_url) ) #Security URL is security challenge URL
resp1 = browser.follow_link(security_url) #Response correctly shows HTML from challenge URL page
forms = list(browser.forms())
for i in range(len(forms)):
print( forms[i].name ) #Form[0] - must contain a control called 'verify' it doesn't
browser.select_form( nr = 0)
browser.form['verify'] = SECRET
resp = browser.submit()
print( resp.getcode() )
print( resp.read() )
That's useless without LOGIN_URL and SECRET
The Login url is https://m.facebook.com/profile.php?id=100002233045625&tsid=0.48424488103504615&source=result Can you help
Mechanize Browser object is unable to find form on the second page of the login process. Internal data structure of the browser object seems to hold information about the original form.
Here are the chain of events in the multi-stage login process:
Sample code is shown below: