[Tutor] Interfacing to the web

andy surany mongo57a@comcast.net
Wed Oct 23 13:09:02 2002


Thanks Rob.

Yes, it is easy to open the default browser. But I need to have "hooks" into
the browser to parse the return string(s).

Unfortunately, there is no other way to get to the data (financial data on a
secure site). My only other alternative would be to record the entire
session and use urllib to "playback" the session (prompting the user for
password info). I would also have to "transpose" the cookies. This does not
allow for direct interaction with the site, but should accomplish the task.
And I think it might be a whole heck of a lot easier.

What do you guys think? I will look at the libs you mentioned to see what is
available.

Regards,

Andy
-----Original Message-----
From: Rob <rob@uselesspython.com>
To: tutor@python.org <tutor@python.org>
Date: Wednesday, October 23, 2002 12:12 PM
Subject: RE: [Tutor] Interfacing to the web


>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
>
>
>
>_______________________________________________
>Tutor maillist  -  Tutor@python.org
>http://mail.python.org/mailman/listinfo/tutor