0

Those are the three things I can tell you about the form I am trying to submit using python. I am trying to scrape the database found here, for individuals.

The form's "action" points straight back to SearchIndividual.aspx when the results are normally displayed on SearchResults.aspx. That's one thing that I am unsure how to handle.

The form's "onsubmit" also performs a javascript function I am unsure of.

What I can tell you is that this type of technique has been successful for me in the past, but it isn't duplicable to this situation:

import urllib, urllib2

mydata=[('ctl00$ctl00$mainContent$mainContent$scLastName','Smith')]
mydata=urllib.urlencode(mydata)
path='http://pfr.informe.org/ALMSOnline/ALMSQuery/SearchResults.aspx'
req=urllib2.Request(path, mydata)
req.add_header("Content-type", "application/x-www-form-urlencoded")
page=urllib2.urlopen(req).read()
print page
2
  • What's the need to mix all these languages? It's usually a pretty bad idea to write code in one language that generates code in another language. Commented May 14, 2015 at 16:55
  • I didn't build the website I am trying to scrape. But I just want to use python to scrape it because that's what I am most comfortable with.
    – Mr. A
    Commented May 14, 2015 at 16:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.