urllib.urlopen doesn't work
Josef Cihal
josef.cihal at gmx.at
Fri Sep 2 18:09:44 EDT 2005
Hallo,
i need a help with module URLLIB.
I am trying to open url via:
- urllib.urlopen
('http://brokerjet.ecetra.com/at/markets/stocks/indices.phtml?notation=92866')
Problem is, that I am always redirecting to
- LOGIN page (www.brokerjet.at),
and cannot get my page with "news", which I want to download.
Can it be, that I forgot to pass all (hidden too) parameters to form by submit?
Is it possible to get (ask) for all existing valid parameters, which I need to pass to form
for getting requested page?
Is action submit correct in my case?
Thank you very much for all your help or ideas
Code (Python 2.3.3, Windows)
=========================
import urllib2, os,sys, urllib
x = urllib.urlopen( 'http://brokerjet.ecetra.com/at/markets/stocks/indices.phtml?notation=92866',
urllib.urlencode({ 'iNotation':'92866',
'keyword':'',
'fulltext':'1',
'value':'',
'action': 'Submit'}))
data = x.readlines()
#
f = open(r"C:\Tmp\Brokerjet\login.html","w")
f.writelines(data)
f.close()
os.system(r"C:\Tmp\Brokerjet\login.html")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050903/aac9a7fb/attachment.html>
More information about the Python-list
mailing list