I am trying to parse review from this page: http://www.amazon.co.uk/product-reviews/B00143ZBHY
Using following approach:
Code
html # a variable which contains exact html as given at the above page.
from lxml import etree
tree = etree.HTML(html)
r = tree.xpath(".//*[@id='productReviews']/tbody/tr/td[1]/div[9]/text()[4]")
print len(r)
print r[0].tag
Output
0
Traceback (most recent call last):
File "c.py", line 37, in <module>
print r[0].tag
IndexError: list index out of range
p,s,: While using the same xpath on xpath checker addon of firefox I am able todo it easily. But no result here, please help!