Part-Selenium-1

1.在浏览器中的console输入:帮助定位

> $x('xpath表达式')

> $('css表达式')

2.driver

> chrome driver: https://npm.taobao.org/mirrors/chromedriver

> firefox:https://github.com/mozilla/geckdriver/realeases/tag/v0.24.0

3.简易的页面性能

> raw_json = webdriver.execute_script("return JSON.stringify(window.performance.timing)"),返回的内容,比requests多,有些事它拿不到的

4.remote server

> 下载selenium server,启动

> 通过webdriver.remote()来连接到服务器

猜你喜欢

转载自www.cnblogs.com/n-n5980/p/11934837.html