【发布时间】:2022-01-03 15:42:49
【问题描述】:
我正在尝试使用 python selenium 从下拉栏中选择一个元素,并选择 start_date 和 end_date。请找到网址:
<select title="drop_down" name="sType1" class="single_select2" style="display: none;" id="single_select_2">
<option value="">choice</option>
","
<option value="2101">issuance</option>
","
<option value="2701">listing</option>
","
</select>
我使用代码:
driver.get('http://www.sse.com.cn/disclosure/bond/announcement/npcorporate/')
driver.implicitly_wait(20)
s1 = Select(driver.find_element_by_id('single_select_2'))
driver.implicitly_wait(20)
s1.select_by_value('2101')
driver.find_element_by_id('btnQuery').click()
但是网站说:
ElementNotInteractableException: element not interactable: Element is not currently visible and may not be manipulated' how could I make it visible and able to select it?
而且我不知道如何将我的代码用于选择日期。有可能吗?
任何帮助将不胜感激!
【问题讨论】:
-
哪一行出错了?
-
您发送的页面没有 id=single_select_2 的元素,即使等待了很长时间。
-
您好,感谢您的帮助,抱歉我放错了链接,现在我更新了,应该没问题http://www.sse.com.cn/disclosure/bond/announcement/npcorporate/跨度>
标签: python selenium selenium-webdriver select drop-down-menu