How to POSTcall and retrieve result page
suyash jape
suyashjape at gmail.com
Fri Jan 11 01:25:06 EST 2008
Hi all
i want to access a web page through python script, fillup the necessary
fields,
and press submit button (which does POST call) and retrieve the result page
and retrieve some values from it.
Here is the script i have written till now.
>import urllib2
> # create array of name/value pairs
> self.params = urllib.urlencode({'seqname': 'BioSequence', 'sequence':
'ATACATTATCCAAACATAAAAAGCATGGCTT'})
>
> # send http-post
> request = urllib.urlopen("http://www.hydrazome.metazome.net/search.php",
params)
>
> # read back each line of reply
> line = request.read()
>print line
This script fills up the correct values in the search.php page.But i am not
sure if it is doing the POST (submit call).
Beacause in 'line' varialble, i am getting the search.php page.Not the
result page which is blast_results.php.
How to retrieve the result page?
Thanks
Suyash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080111/506436f3/attachment.html>
More information about the Python-list
mailing list