Skip to content Skip to sidebar Skip to footer

How To Make Mechanize Not Fail With Forms On This Page?

import mechanize url = 'http://steamcommunity.com' br=mechanize.Browser(factory=mechanize.RobustFactory()) br.open(url) print br.request print br.form for each in br.forms():

Solution 1:

Did you mention that the website is redirecting to an https (ssl) server ?

Well, try to set a new HTTPS handler like this:

mechanize.HTTPSHandler()

Solution 2:

Use this secret, i'm sure this is work for you ;)

br = mechanize.Browser(factory=mechanize.DefaultFactory(i_want_broken_xhtml_support=True))

Post a Comment for "How To Make Mechanize Not Fail With Forms On This Page?"