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
添加回答
举报