[Tutor] urllib, urlopen and the evil frames

Glen Wheeler wheelege@tsn.cc
Fri, 6 Apr 2001 22:47:39 +1000


  Hi all,

  I've noticed alot of use of Urllib lately and I thought it would be funky
to be able to navigate around and pass arguments to cgi scripts through a
python script.
  But I've hit a kind of snag.  Basically, this is what I am looking at
wanting to do...

  1. Log into server
  2. Navigate to a page with some prices
  3. Take the page html code as input then..
  4. Use regular expressions to tell the user of the prices, then do what
they tell you
  -OR-
  4. Go into complete auto-mode and do some buying, selling, etc based on
some rules and things like that.

  This is for an online game, before any of you suspicious types start
looking my direction :)  And no it's not bad to do it on this game
server....I think.
  Anyway, I've gotten past step 1, and I logged in by just passing arguments
to a few cgi scripts in an order using urllip.urlopen but when I get to
navigating around in step 2 I just get returned (through ye olde urllib)
'blah blah This browser does not support frames'.  So I thought 'bah who
needs that page anyway' and then tried to access the market cgi-script using
urlopen but then it spits at me saying I haven't logged in yet.
  So now I'm stuck.  Surely there must be a way to just go 'look website, I
don't care about frames just let me take all the source you've got, I don't
care how many frames/html files you have'.

  Thanks guys,
  Glen.