【问题标题】:Selenium links request [duplicate]Selenium 链接请求 [重复]
【发布时间】:2020-05-01 12:25:18
【问题描述】:

我正在尝试使用 selenium 从站点下载 python.exe。所以我正在使用该代码:

    from selenium import webdriver
    from selenium.webdriver.common.keys import Keys
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC

    driver = webdriver.Chrome("C:\\Program Files\\chromedriver.exe")
    driver.get("https://www.python.org/downloads/")
    try:
        c = WebDriverWait(driver,10).until(EC.presence_of_element_located(By.LINK_TEXT,"Download 
    Python 3.8.2"))
        c.click()
    finally:
        driver.quit()

但是shell总是说:

   TypeError: __init__() takes 2 positional arguments but 3 were given

有什么问题?谢谢

【问题讨论】:

    标签: python python-3.x selenium web web-scraping


    【解决方案1】:

    您缺少()

    presence_of_element_located((By.LINK_TEXT,"Download Python 3.8.2")))
    

    【讨论】:

      猜你喜欢
      • 2021-12-14
      • 1970-01-01
      • 2013-03-27
      • 1970-01-01
      • 1970-01-01
      • 2014-07-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多