Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Python HTML Scraping

Avatar of paulkramer
paulkramer asked on
Python
6 Comments1 Solution753 ViewsLast Modified:
I need to somehow parse one parameter to an HTML form and perform a click action on the submit button and have decided I want to use Python. There are examples floating around the web on how to perform this (http://docs.python.org/3.1/howto/urllib2.html), but none offer any insight on how to deal with the onclick action I'm dealing with. See the form code below:

<button onclick="AJAX_REQUEST_STATUS=1; searchButtonPressed=true; this.form.filter_page.value=1; submitSearch(document.frm, 'searchMyRecHoldings.shtml?orerFlag=public&amp;');" id="searchButton" type="button">Search</button>

I've tried the following without success:

import urllib
params = urllib.urlencode({'genYear': 2010, 'onClick': 'AJAX_REQUEST_STATUS=1;\
                           searchButtonPressed=true; this.form.filter_page.value=1; submitSearch(document.frm, ''searchMyRecHoldings.shtml?orerFlag=public&'')'})
f = urllib.urlopen("https://www.rec-registry.gov.au/getSearchPublicRecHoldings.shtml", params)
print f.read()

ASKER CERTIFIED SOLUTION
Avatar of paulkramer
paulkramer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers