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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -