SHARE
TWEET

lxml xpath parse table

reclosedev Apr 1st, 2012 571 Never
  1. import lxml.html
  2.  
  3. doc = lxml.html.parse('test.html')
  4. rows = doc.xpath('//tr')
  5. data = [row.xpath('./*/text()') for row in rows]
RAW Paste Data
Top