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

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

使用selenium webdriver時(shí)出現(xiàn)超時(shí)問(wèn)題

使用selenium webdriver時(shí)出現(xiàn)超時(shí)問(wèn)題

HUWWW 2023-07-11 15:29:54
這是我的 python 腳本:#!/usr/bin/python3# -*- coding: utf&shy;-8 &shy;-*-from selenium import webdriverfrom selenium.webdriver.chrome.options import Optionsfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support import expected_conditions as ECimport osoptions = Options()options.headless = Trueoptions.add_argument("window-size=1400,800")options.add_argument("--no-sandbox")options.add_argument("--disable-gpu")options.add_argument("start-maximized")options.add_argument("enable-automation")options.add_argument("--disable-infobars")options.add_argument("--disable-dev-shm-usage")driver = webdriver.Chrome(options=options)driver.get('https://paris-sportifs.pmu.fr/pari/sport/25/football')odds = [my_elem.text for my_elem in WebDriverWait(driver, 10).until(EC.visibility_of_all_elements_located((By.XPATH, '//a[contains(@href, "#")]')))]print(odds, '\n')driver.close()driver.quit()輸出給我的是:Traceback (most recent call last):? File "./azerty.py", line 31, in <module>? ? odds = [my_elem.text for my_elem in WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.XPATH, '/-a[contains(@href, "#")]')))]? File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/support/wait.py", line 80, in until? ? raise TimeoutException(message, screen, stacktrace)selenium.common.exceptions.TimeoutException: Message:?該腳本可以與其他網(wǎng)頁(yè)完美運(yùn)行,但在本例中則不然。一些幫助,謝謝
查看完整描述

1 回答

?
哈士奇WWW

TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超6個(gè)贊

請(qǐng)測(cè)試這段代碼;請(qǐng)?jiān)黾拥却龝r(shí)間并使用 EC.presence_of_all_elements_ located 。


from selenium.webdriver.common.by import By

from selenium.webdriver.support import expected_conditions as EC

import os


options = Options()

options.headless = True

options.add_argument("window-size=1400,800")

options.add_argument("--no-sandbox")

options.add_argument("--disable-gpu")

options.add_argument("start-maximized")

options.add_argument("enable-automation")

options.add_argument("--disable-infobars")

options.add_argument("--disable-dev-shm-usage")


driver = webdriver.Chrome(options=options)


driver.get('https://paris-sportifs.pmu.fr/pari/sport/25/football')


odds = [my_elem.text for my_elem in WebDriverWait(driver, 50).until(EC.presence_of_all_elements_located((By.XPATH, '//a[contains(@href, "#")]')))]


print(odds, '\n')


查看完整回答
反對(duì) 回復(fù) 2023-07-11
  • 1 回答
  • 0 關(guān)注
  • 223 瀏覽
慕課專欄
更多

添加回答

舉報(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)