2 回答

TA貢獻1799條經驗 獲得超6個贊
如果你正在尋找代碼。這可能會有所幫助:-
from selenium import webdriver
import time
webpage = 'https://web.sensibull.com/optionchain?expiry=2020-03-26&tradingsymbol=NIFTY'
driver = webdriver.Chrome(executable_path='Your/path/to/chromedriver.exe')
driver.get(webpage)
time.sleep(10)
nifty_fut = driver.find_element_by_xpath('//*[@id="app"]/div/div[4]/div[2]/div[3]/div/div/div[2]/div[1]/div[1]/div/button/span[1]/div[1]')
print(nifty_fut.text)
atm_iv = driver.find_element_by_xpath('//*[@id="app"]/div/div[4]/div[2]/div[3]/div/div/div[2]/div[1]/div[2]')
print(atm_iv.text)
driver.quit()

TA貢獻1829條經驗 獲得超7個贊
可能是語法問題嘗試或只是soup.find_all("div", class_="style__AtmIVWrapper-idZNMX kUMMRI")
soup.find("div", class_="style__AtmIVWrapper-idZNMX kUMMRI")
如果對網頁抓取和bs4感興趣,請查看文檔 https://www.crummy.com/software/BeautifulSoup/bs4/doc/#find
添加回答
舉報