Hi everyone, I am a novice with Python and learning BeautifulSoup. I understand (at least I think) the basics and have done some succesfull scraping (it's fun).
However, when trying to get the table from this site 'https://bors.e24.no/#!/instrument/PCIB.OSE/orderdepth' there's no way I can get the tags/properties right in the soup.find_all command. For several days I have been wrestling with this page with no luck. Any ideas what tag properties I should look for?
Just tried with the XPATH in lxml at no avail...
However, when trying to get the table from this site 'https://bors.e24.no/#!/instrument/PCIB.OSE/orderdepth' there's no way I can get the tags/properties right in the soup.find_all command. For several days I have been wrestling with this page with no luck. Any ideas what tag properties I should look for?
1 2 3 4 5 6 7 8 9 10 |
from lxml import html import requests response = requests.get(url) tree = html.fromstring(response.content) #lxml_soup = tree.xpath('/html/head/title/text()')[0] lxml_soup = tree.xpath( '//*[@id="mainContainer"]/div[2]/ui-view/div/div/div/div/orderdepth/table/tbody/tr[1]/td[1]' )[ 0 ] print (lxml_soup) |