我正在嘗試抓取此網站https://www.parkers.co.uk但由于某種原因我似乎無法通過彈出的 cookie,我已經嘗試使用此代碼
cookies = driver.find_element_by_xpath('//*[@id="notice"]/div[5]/button[2]') cookies.click()
但它似乎沒有作業,我該怎么辦?
uj5u.com熱心網友回復:
嘗試這個:
iframe = driver.find_element_by_xpath("//iframe[@title='SP Consent Message']")
driver.switch_to.frame(iframe)
driver.find_element_by_xpath("//button[@title='Accept All']").click()
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/490650.html
