View Single Post
Join Date: May 2008
Posts: 538
Reputation: Murtan is a jewel in the rough Murtan is a jewel in the rough Murtan is a jewel in the rough Murtan is a jewel in the rough 
Solved Threads: 86
Murtan Murtan is offline Offline
Posting Pro

Re: query inside a webpage with Python

 
0
  #2
Jan 6th, 2009
This is the essential parts of the 'source' for the basic search form extracted from the web page you indicated:

  1. <form action="/search.php#results" method="post">
  2. <strong>Basic Search </strong>
  3. <strong>First Name:</strong><br> <input name="fFIRSTNAME" type="text" size="10" maxlength="25" value="">
  4. <strong>Last Name:</strong><br> <input name="fLASTNAME" type="text" size="10" maxlength="25" value="">
  5. </form>

The <form> tells you that the form data is sent to the server via post, and the <input>'s give the field names 'fFIRSTNAME' and 'fLASTNAME'

You then 'encode' the form data and post it to the server.

There's a pretty good article on how to do that here:

http://www.voidspace.org.uk/python/a.../urllib2.shtml
Reply With Quote