I am new to scrap from websites. I want to locate and download "price, delta, vol" data from this webpage . These data is in a table and scattered under tags of tenors. I tried following python code:
url = 'https://widget.sentryd.com/widget/#/7D5623FD-E378-411E-A354-C93D10583540' ## 网页版地址
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
page = requests.get(url,headers = headers)
soup = BeautifulSoup(page.text,'lxml')
script = soup.find_all('table')
But I only get a blank list []. How can I locate the data table and extract the data from the website? Thank you very much.
This is the closest solution I can find rather than the data I want.
import requests
from bs4 import BeautifulSoup
import pandas as pd
url = 'https://widget.sentryd.com/widget/#/7D5623FD-E378-411E-A354-C93D10583540'
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
page = requests.get(url,headers = headers)
soup = BeautifulSoup(page.content,'html.parser')
tables = pd.read_html(soup.text)
print(tables[0])
The result is a dataframe with field names but not the data I need. Please advise me how to do. Thanks