【问题标题】:Selenium webdriver can't see elements [duplicate]Selenium webdriver看不到元素[重复]
【发布时间】:2021-01-11 20:26:00
【问题描述】:

我已经多次尝试使用不同的 xpath 和选择器。 屏幕中的 HTML。

例子:

driver.find_element_by_xpath('//div[contains(@class, "task-info-panel-title")]/descendant::input[contains(@name, "[ARGUMENTS][data][TITLE]")]').send_keys("123)
wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="task-form-bitrix_tasks_task_default_1"]/div[1]/div[1]/div[2]/input'))).send_keys("123)

我收到以下错误:

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element:[![enter image description here][1]][1]"//*[@id="task-form-bitrix_tasks_task_default_1"]/div[1]/div[1]/div[2]/input"}
selenium.common.exceptions.TimeoutException: Message:

【问题讨论】:

    标签: python-3.x selenium-webdriver xpath automation qa


    【解决方案1】:

    这似乎是您选择了错误的 XPath,下面的尝试可能是这项工作。

    wait.until(EC.presence_of_element_located((By.XPATH, '//input[@placeholder='Rzeczy do zrobienia']'))).send_keys("123");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-11
      • 2016-09-07
      • 2017-10-24
      • 1970-01-01
      相关资源
      最近更新 更多