天天看点

selenium之chromedriver

1、chromedriver下载

chromedriver(谷歌浏览器驱动)下载地址:http://chromedriver.storage.googleapis.com/index.html

chromedriver和chrome的版本要相对应,可阅读每个chromedriver版本目录下的notes.txt文件判断你需要下载哪个版本的chromedriver。

2、chromedriver使用

将下载好的chromedriver.exe放到python的安装目录下即可。

以下是截取的notes.txt部分内容:

----------ChromeDriver v2.43 (2018-10-16)----------
Supports Chrome v69-71
Resolved issue 2537: Parsing of proxy configuration is not standard compliant [[Pri-1]]
Resolved issue 2607: Launch App command is flaky [[Pri-2]]
Resolved issue 2575: Screenshot of element inside iFrame is taken incorrectly [[Pri-2]]
Resolved issue 1855: Feature request : ChromeDriver to support window resizing over a remote connection [[Pri-2]]
Resolved issue 1998: Error codes are not handled in Clear element [[Pri-2]]
Resolved issue 2016: Not Waiting until element is visible [[Pri-2]]
Resolved issue 1936: Get element property is not implemented [[Pri-2]]
Resolved issue 1992: Switch To Frame is not spec compliant [[Pri-2]]
Resolved issue 2001: Execute Async Script does not return spec compliant error codes [[Pri-2]]
Resolved issue 2000: Execute Script does not return spec compliant error codes [[Pri-2]]
Resolved issue 1987: Error code in ExecuteGet is not conformant with spec [[Pri-2]]
Resolved issue 2003: Send Alert Text is not returning spec compliant error codes [[Pri-2]]
Resolved issue 1319: clear() on an input type="date" pretends element is not user-editable [[Pri-3]]
Resolved issue 1404: Chromedriver gets window handle for the tab which is opened manually [[Pri-3]]
Resolved issue  586: Allow append or start a new log file for chromedriver [[Pri-3]]
Resolved issue 2371: New Session does not invoke w3c mode if flag is in firstMatch [[Pri-]]

----------ChromeDriver v2.42 (2018-09-13)----------
Supports Chrome v68-70
Resolved issue 2144: Test testClickElement from MobileEmulationCapabilityTest class fails on Chromium for all platforms [[Pri-1]]
Resolved issue 2566: whitelisted-ips not working with ipv4 [[Pri-1]]
Resolved issue 2541: chromedriver v2.41 fails to start with whitelisted-ips flag on macOS [[Pri-1]]
Resolved issue 2057: Set Timeouts is not implemented [[Pri-1]]
Resolved issue 1938: Take element screenshot not implemented in Chromedriver [[Pri-2]]
Resolved issue 2550: chromedriver ignores PATH when searching for chrome binary [[Pri-2]]
Resolved issue 1993: Fullscreen Window command not spec compliant [[Pri-2]]
Resolved issue 2501: Implement log-replay functionality [[Pri-2]]
Resolved issue 2552: Some error codes are not standard compliant [[Pri-2]]
Resolved issue  669: console.log with multiple arguments not handled properly [[Pri-2]]
Resolved issue 2545: Getting "unknown error: getting size failed to return x" for SVG rect [[Pri-2]]
Resolved issue 2571: chromedriver 2.35 ~ 2.41 - touch emulation not working (swipe) [[Pri-]]

----------ChromeDriver v2.41 (2018-07-27)----------
Supports Chrome v67-69
Resolved issue 2458: Chromedriver fails to start with whitelisted-ips option [[Pri-1]]
Resolved issue 2379: Returned capabilities should include remote debugging port [[Pri-2]]
Resolved issue 1005: driver.manage().window().getSize() is not implemented on Android [[Pri-2]]
Resolved issue 2474: desktop launcher error messages are not readable by users [[Pri-]]
Resolved issue 2496: Fail fast when not able to start binary [[Pri-]]
Resolved issue 1990: Close Window return value does not conform with spec [[Pri-]]

----------ChromeDriver v2.40 (2018-06-07)----------
Supports Chrome v66-68
Resolved issue 2446: Regression: Chromedriver 2.39 hangs on open when user-data-dir is specified and exists [[Pri-1]]
Resolved issue  779: Make ChromeDriver able to listen on requests from IPv6. [[Pri-1]]
Resolved issue 2339: Chromedriver couldn't find the Android file using valid file path [[Pri-2]]
Resolved issue 2307: /session/:sessionId/send_command and /session/:sessionId/send_command_and_get_result should be changed to be proper extension commands [[Pri-]]