1 回答

TA貢獻(xiàn)1858條經(jīng)驗(yàn) 獲得超8個(gè)贊
你可以使用硒來做到這一點(diǎn)。
from selenium import webdriver
import time
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get('https://bet365.apps.imgarena.com/golf/3.18.0/full/?eventId=183&language=en&options=eyJ2aWRlb1BsYXliYWNrRW5hYmxlZCI6ZmFsc2V9#/group/30')
shotsbtn = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH,'//*[@id="root"]/div/div/div/div/div[3]/div[3]')))
shotsbtn.click()
print(driver.page_source)
這將帶您進(jìn)入照片頁面。并且driver.page_source會(huì)給你頁面的html代碼,你可以進(jìn)一步解析它以獲得你想要的數(shù)據(jù)。
添加回答
舉報(bào)