Xpath无法在网页中找到日历元素

时间:2019-10-03 00:24:14

标签: python selenium

我正在尝试查找硒,然后在webapge custom SSL certificates are not supported上单击不同的时间。我有一个睡眠计时器来加载整个页面,然后甚至向下滚动,然后使用Pynput单击想要的日期,但是我无法让Selenium Finder找到任何可用的时间。

from selenium import webdriver 
import time from pynput.mouse import Button, 
Controller driver = webdriver.Chrome(r'C:\Users\abdoo\OneDrive\Desktop\chromedriver.exe') 
driver.get('macengsociety.ca/hatch-booking-1/h201/book') 
time.sleep(5) 
driver.execute_script("window.scrollTo(0, 1080)") 
time.sleep(1) 
mouse = Controller() 
mouse.position = (340, 475) 
mouse.click(Button.left, 1) 
time.sleep(1) 
elem = driver.find_element_by_xpath("/html/body/main/div/bks-app/div/div[1]/boost-calendar-page/div[2]/div/div/div/ul/boost-time-slots-list[3]/li/div[2]/span") 
elem.click() –

0 个答案:

没有答案
相关问题