API命令

1,is_displayed()

例子:driver.find_element_by_css_selector("#id").is_displayed()

该元素是否可见

2,title

例子:

title=driver.title

print (title)

3,url

例子:

url=driver.current_url

print (url)

4,text

user=driver.find_element_by_css_selector(".class").text

print (user)

此处注意,text后面没有括号。不然,报错的。

另外,虫师著作的SELENIUM书中97页有提供expected_conditions类提供的预期条件判断的方法。

有空可以多练习一下。

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2021-11-24
  • 2022-12-23
  • 2021-10-03
  • 2021-06-12
  • 2021-06-27
猜你喜欢
  • 2022-12-23
  • 2021-09-08
  • 2021-11-20
  • 2022-01-14
  • 2021-06-09
  • 2022-12-23
  • 2021-07-12
相关资源
相似解决方案