第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Python 2.7 Selenium 網(wǎng)站上沒有這樣的元素

Python 2.7 Selenium 網(wǎng)站上沒有這樣的元素

開心每一天1111 2021-10-05 16:55:19
我正在嘗試從博彩網(wǎng)站進(jìn)行一些網(wǎng)絡(luò)抓?。鹤鳛檫^程的一部分,我必須點(diǎn)擊左側(cè)“收藏夾”部分下的不同按鈕來選擇不同的比賽。我們以 ENG Premier League 按鈕為例。我將按鈕標(biāo)識(shí)為:XPath 為://*[@id="SportMenuF"]/div[3],ID 為 91。我點(diǎn)擊按鈕的代碼如下:from selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECchrome_path = "C:\Python27\Scripts\chromedriver_win32\chromedriver.exe"driver = webdriver.Chrome(chrome_path)driver.get("URL Removed")content = driver.find_element_by_xpath('//*[@id="SportMenuF"]/div[3]')content.click()不幸的是,我在運(yùn)行腳本時(shí)總是收到此錯(cuò)誤消息:"no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="SportMenuF"]/div[3]"}" 我嘗試了不同的標(biāo)識(shí)符,例如 CCS Selector、ID 以及如上例所示的 Xpath。我也嘗試使用等待和顯式條件。這些都沒有奏效。我還嘗試從網(wǎng)站上抓取一些值,但沒有成功:from selenium import webdriverfrom selenium.webdriver.common.by import Bychrome_path = "C:\Python27\Scripts\chromedriver_win32\chromedriver.exe"driver = webdriver.Chrome(chrome_path)driver.get("URL removed")content = driver.find_elements_by_class_name('price-val')for entry in content:    print entry.text同樣的問題,什么都不顯示。該網(wǎng)站嵌入了來自不同網(wǎng)站的 iframe。這可能是我問題的原因嗎?我也嘗試直接從 iframe URL 中抓取,但也沒有用。我將不勝感激任何建議。
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 195 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)