driver.get("https://www.booking.com")

//通过 xpath 等待input 元素 是否 加载出来, 最大等 60s
input_blno = WebDriverWait(driver, 60).until(
        EC.presence_of_element_located((By.XPATH, """//*[@>))
    )



//通过 xpath 定位 元素 ,点击元素
the_butten = driver.find_element(By.XPATH, '//*[@]/input')
the_butten.click()


//判断页面 是否 包含什么 内容
if 'DOCUMENT does not exist' in driver.page_source:
print "nononoon"
return None
//光标 移动 
//动态 找到 tr
t_d_butten = driver.find_element_by_xpath("""//*[@ % (i + 1))
# 光标 移动到 目标位置
ActionChains(driver).move_to_element(t_d_butten).perform()
time.sleep(1)
# 点击这一行
t_d_butten.click()
time.sleep(0.5)


 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2021-05-08
  • 2021-12-08
猜你喜欢
  • 2021-08-22
  • 2021-09-11
  • 2022-12-23
  • 2021-11-21
  • 2021-07-23
相关资源
相似解决方案