----- Original Message -----
From: Josef Cihal
Sent: Saturday, September 03, 2005 12:09 AM
Subject: urllib.urlopen doesn't work 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 = "">
#
f = open(r"C:\Tmp\Brokerjet\login.html","w") f.writelines(data) f.close() os.system(r"C:\Tmp\Brokerjet\login.html") |
-- http://mail.python.org/mailman/listinfo/python-list