我想单击日历中的某一天(不管哪一天)是否可用
有些日子是可以利用的,而有些日子是没有的
日历是用table
标记制作的,每个td
标记如果不可用,都有一个类notSelectableDay
。在
我必须重新加载页面,直到程序找到一个可用的日期,其中包含类selectableDay
。在
程序结构是在我提出的另一个问题if else loop on Python. Checking a class name with Selenium
这是否可行:
if driver.find_elements_by_class_name("selectableDay"):
driver.find_element_by_class_name("selectableDay").click()
我提出了另一个更明确的问题:
I got a calender picker. How to select the available day with Selenium and Python?
也许这能起作用。。相反,用xpath找到_元素,但我认为它还是可以工作的。。在
下面是一段代码,您可以从日历中选择所需的日期。只需通过您想从日历中选择的日期。在
如果要从日历中选择日期10,请将字符串“10”传递给函数
示例:
datepicker("10")
如果你有什么问题请告诉我。在
相关问题 更多 >
编程相关推荐