HTML scraping in python

Paul Lussier p.lussier at comcast.net
Thu Jun 11 12:29:29 EDT 2009


So, I have the tables from the page in a list.  Taking a hint from
Shawn's example, I can get this:

(Pdb) tables[0].input
<input name="_label" type="text" id="_label" style="width:30px; vertical-align:bottom;" value="foo" />

I need to now parse this input tag into it's separate elements so I
can get at 'name' and 'value'.

Ooh, it appears I can do this:

 tables[0].input.get('name')
 tables[0].input.get('value')

Excellent!

Thanks everyone ;)
-- 
Seeya,
Paul


More information about the gnhlug-discuss mailing list