[Tutor] Re: [Pythonmac-SIG] Problem with urllib.openurl()

Jack Jansen jack@oratrix.nl
Fri, 20 Jul 2001 15:17:44 +0200


> For some time now, I've been using the myfile=urllib.openurl('URL path')
> construct to suck data files off the Web.  Now I'm trying to use it to
> get both historical and real-time snapshots of stock portfolio prices.
> [...]
> The real-time data, however, does not make it into the Python-created
> file "myfile".  I get HTML stuff showing in that file, but no data.  I
> suspect that the problem arises in the Web site's use of cgi-bin to
> create the price table on the fly.  

CGI or not on the server side shouldn't be a problem. A couple of things that 
would be a problem:
- If the data isn't normally displayed as-is but interpreted by, say, a java 
applet or a plugin or something. The "html stuff" you mention could well be 
something that starts the plugin. It might even be java or javascript code 
that gets the data. Why not post the html code here?
- There is a small possibility that the server-side looks at the browser type 
you're using and returns different info for explorer and netscape. If it only 
recognizes those two it could be that it returns nothing if your browser is 
not one of those. I've seen webpages do this:-( And, of course, urllib is 
neither Netscape nor Explorer.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm