Comments (3)
Workaround for people who stumble over this bug. Execute at the beginning of your code:
import mechanize
from mechanize import _request
from mechanize._form import ControlNotFoundError
def _click(self, name, type, id, label, nr, coord, return_type,
request_class=_request.Request):
try:
control = self._find_control(
name, type, "clickable", id, label, None, nr)
except ControlNotFoundError:
if ((name is not None) or (type is not None) or (id is not None) or
(nr != 0) or (label is not None)): # fixed by cvogt, see http://github.com/jjlee/mechanize/issues/16
raise
# no clickable controls, but no control was explicitly requested,
# so return state without clicking any control
return self._switch_click(return_type, request_class)
else:
return control._click(self, coord, return_type, request_class)
mechanize._form.HTMLForm._click = _click
from mechanize.
Fix failure to raise on click for nonexistent label
Closed by 28b77f5
from mechanize.
that was quick, thanks so much!
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.
from mechanize.