繁体   English   中英

亚马逊卖家中心 Selenium 下拉 select 错误使用 Python

[英]Amazon Seller Central Selenium dropdown select error using Python

我一直在尝试自动化亚马逊卖家中心的存储报告下载。 我尝试将 select function 用于其他下拉选项。 这是我为其他下拉菜单编码并工作的内容:

select = Select(driver.find_element_by_id('downloadDateDropdown'))

select.select_by_value('0')

但是,当我在另一个形状和设计不同的下拉菜单上尝试此方法时,我不断收到一条消息,提示 python 找不到该元素。

以下是来自卖方中心的代码,我一直在尝试使用 Selenium 进行自动化:来自卖方中心的代码

谢谢您的帮助!

在您附加的 html 中,没有值为“downloadDateDropdown”的属性 id

Also there are no select tag in the html, you can use select class with select tags. 对于其他标签使用正常点击

  1. 单击下拉菜单以查看列表
  2. 单击显示的选项

代码将是:

WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.XPATH, "//xpathofdropdownmenu"))
).click()

WebDriverWait(driver, 10).until(
    EC.visibility_of_element_located(
        (By.XPATH, "//xpathofoption"))
).click()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM