Привет ниже код работает для меня. Вам нужно использовать селен, чтобы захватить таблицу
from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
import time
webpage = 'https://www.cmegroup.com/trading/energy/crude-oil/light-sweet-crude.html'
driver = webdriver.Chrome(executable_path='Your/path/to/chromedriver.exe')
driver.get(webpage)
time.sleep(15)
html = driver.page_source
soup = BeautifulSoup(html, "html.parser")
table = soup.find('table')
table_rows = table.find_all('tr')
res = []
for tr in table_rows:
td = tr.find_all('td')
row = [tr.text.strip() for tr in td if tr.text.strip()]
if row:
res.append(row)
df = pd.DataFrame(res, columns=["Month", "Charts", "Last","Change","Prior Settle","Open ","High","Low","Volume","Hi / Low Limit","Updated"])
print(df)
driver.quit()