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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -