Comments (1)
Search for "RobustFactory" in the FAQ
http://wwwsearch.sourceforge.net/mechanize/faq.html
You may find that you need the latest code from git due to issue #15
Here's code that doesn't raise an exception for me:
import mechanize
html = """\
<form method="post" name="login" >
<br/>
<input type="text" name="username" />
<input type="submit" />
<input type="password" name="passwd" >
</form>
"""
browser = mechanize.Browser(mechanize.RobustFactory())
response = mechanize.make_response(
html, [("Content-Type", "text/html")],
"http://example.com/", 200, "OK")
browser.set_response(response)
browser.select_form("login")
browser["passwd"] = "no problem"
browser["username"] = "problem"
from mechanize.
Related Issues (20)
- _form.py have an error
- HTML5 element not visible
- Updating referer in case of URL redirection
- ImportError HOT 2
- ParseError: OPTION outside of SELECT if there is <option> tag somewhere inside <script> tag
- urllib2.URLError: <urlopen error no host given> HOT 1
- Does this mechanize poke private implementation of socket.py?
- open response in browser after submit forms
- Mechanize parses <script> contents with bad results HOT 1
- Incorrect textarea CRLF normalization when parsing chunks.
- add_file with image/gif file
- Python Mechanize can no longer log into Amazon.com
- mechanize giving ssl errors
- Plan ongoing support for this library or mark it deprecated here & on PyPI HOT 11
- Authorization with NTLM getting AttributeError: HTTPResponse instance has no attribute '__iter__' HOT 2
- socket.error: [Errno 54] Connection reset by peer on very specific case
- browser.submit() randomly stucks forever without throwing an exception
- clean uninstallation
- Support Python 3 HOT 4
- Fake socket is not compatible with PyPy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
`` in form makes following control invisible
from mechanize.