Comments (2)
I don't follow that -- do you have an example?
from mechanize.
Ok. Here is non-working example:
import mechanize
from BeautifulSoup import BeautifulSoup
br = mechanize.Browser()
br.set_handle_robots(False)
# We are Internet Explorer 6.01
br.addheaders = [
('User-agent', 'Mozilla/4.0 (compatible; MSIE 6.01; Windows NT 6.0)')
]
br.open(r'http://softwarestore.ispfulfillment.com/store/Product.aspx?skupart=I23S14')
br.select_form('aspnetForm')
br.submit('ctl00$MainContent$ddlTypeProduct$db_ddlTypeProduct')
html = br.response().read()
page = BeautifulSoup(html)
option = page.find('a', 'ddlTypeProduct_MenuItem')
target = option['href'].split("'")[1]
br.select_form('aspnetForm')
event_target = br.form.find_control("__EVENTTARGET")
event_target.readonly = False
event_target.value = target
br.submit()
on the last line mechanize submit the form by emulating click on the first clickable control in the form (input with type='image' and name='ctl00$MainContent$ddlTypeProduct$db_ddlTypeProduct'). As a result server sends me wrong page.
I need a clear way to simulate submit from javascript, i.e. without clicking on any controls.
Hope this description is better than the first one...
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.