[Tutor] Interfacing to the web

Rob rob@uselesspython.com
Wed Oct 23 12:12:02 2002


import webbrowser
webbrowser.open('http://www.python.org')

This is a simple way to use the default browser to open a web page, but it
sounds like your problem is a good deal more sophisticated than that.

Have you looked at urrllib and urllib2 to see if they have any utilities
that would be of use to you?

I suspect that the security issues may turn out to be a profound challenge
for this. Do you have any other way to access the data than through a
cookie-driven website?

Rob Andrews
http://uselesspython.com

-----Original Message-----
From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
andy surany
Sent: Wednesday, October 23, 2002 12:03 PM
To: tutor@python.org
Subject: [Tutor] Interfacing to the web


Hi All!

Here is what I need to accomplish:

    From a python program, I need to launch a browser. The user then uses
the browser to interact with the web site. However, the python program must
continually monitor the data from the web site to capture specific data
elements.

    Unfortunately, I can't point the program to the specific URL as there is
a significant and secure (cookies, etc.) exchange that must occur in order
to reach the page.

    In the archives, I found a section on parsing HTML which I think would
be very helpful. However, I am unsure how to a) launch the browser from the
program, and b) how to passively (important point...) interact with the
return data stream (i.e. how to apply html parsing in this case).

Anybody have advice?

TIA
-Andy