Getting source code from frames using urllib

Rene Pijlman reageer.in at de.nieuwsgroep
Thu Feb 27 02:36:17 EST 2003


moxie:
>My current problem is trying to figure out how to retrieve the source
>code of a webpage that uses frames.
[...]
><html><head><title>Some title </title></head>
><frameset rows='120,*' border='5' frameborder='5' framespacing='5'>
><frame name='top' src='top.html' scrolling='no'>
>...
>...
>
>How would I, using this example get the html source of the frame named
>'top'(top.html)

Use the HTMLParser module to parse the HTML file. Override
handle_starttag() to act on the <frame> tags.
http://www.python.org/doc/current/lib/module-HTMLParser.html

-- 
René Pijlman

Wat wil jij leren?  http://www.leren.nl




More information about the Python-list mailing list