python lxml scrapping giving blank result -
i have tried getting blank result
import requests lxml import html response=requests.get('http://www.convertit.com/go/convertit/currency/convert_all_output.asp?fcu=usd') tree = html.fromstring(response.text) print (tree.xpath('//div/table/tbody/tr[41]/td[1]/text()'))
like lol4t0 said in comment, there no tbody
in source. if change last line read
print (tree.xpath('//div/table/tr[41]/td[1]/text()'))
you'll result of ['62.525']
.
Comments
Post a Comment