当前位置:网站首页>Disputes between chromedriver, geckodriver, microsoftwebdriver, iedriverserver and operadriver

Disputes between chromedriver, geckodriver, microsoftwebdriver, iedriverserver and operadriver

2022-06-21 13:45:00 testleaf

Test environment : The operating system is Windows10-64 position
Specific goals : Install five browsers and their drivers

One 、 Google browser

1.Google Chrome Installation

It is recommended to download the latest... From the software management of Tencent computer manager 64 Bit version .
 Insert picture description here

2.chromedriver The download

(1) Open Google browser , Click on the three points in the upper right corner , Choose help -》 About Google Chrome, Click in .
 Insert picture description here
(2) You can see , My browser version is Google Chrome 80.0.3987.163 Of 64 Bit version
 Insert picture description here
(3) Download the driver from Taobao official website , Select the corresponding version .
https://npm.taobao.org/mirrors/chromedriver
 Insert picture description here
80 Is the large version number ,0.3987.163 It's a small version number ;
The large version numbers of the driver and browser must be consistent , The minor version number of the driver must be greater than or equal to the minor version number of the browser .

(4) Next, download on demand , Decompression is obtained. chromedriver.exe File can .
 Insert picture description here
(5) Deposit chromedriver
take chromedriver.exe Copied to the Python Can be installed under the directory .
And python.exe The storage location is the same .

Two 、 Firefox

1.Firefox Installation

It is recommended to download the latest... From the software management of Tencent computer manager 64 Bit version .
 Insert picture description here

2.geckodriver The download

(1) from github Download the latest driver .
https://github.com/mozilla/geckodriver/releases
 Insert picture description here
For the convenience of all friends to download ,geckodriver.exe The file has been put to Baidu online disk .
link : https://pan.baidu.com/s/16sis-AqtzXEI968jU647ig Extraction code : leaf

(2) Decompression is obtained. geckodriver.exe file .

(3) Deposit geckodriver
take geckodriver.exe Copied to the Python Can be installed under the directory .
And python.exe The storage location is the same .

3、 ... and 、Edge browser

1.Microsoft Edge Installation

Please download the latest on Microsoft's official website Edge Browser installation package file MicrosoftEdgeSetup.exe, Click on Download, Click accept and download .
https://www.microsoft.com/en-us/edge
 Insert picture description here
 Insert picture description here
in addition ,http://dl.delivery.mp.microsoft.com/filestreamingservice/files/812c141f-8680-4aaa-83d2-f99316588162/MicrosoftEdgeEnterpriseX64.msi
The link also provides Edge Browser installation package file MicrosoftEdgeEnterpriseX64.msi The download .
For your convenience to download ,MicrosoftEdgeSetup.exe Document and MicrosoftEdgeEnterpriseX64.msi The file has been put into our Baidu online disk , Choose one of them Download it .
link : https://pan.baidu.com/s/16sis-AqtzXEI968jU647ig Extraction code : leaf
Last , Just install it by default .

2.MicrosoftWebDriver The download

(1) Start by opening Edge browser , Click on the three points in the upper right corner , Select help and feedback -》 About Microsoft Edge, Click on it. .
 Insert picture description here
(2) You can see , My browser version is Microsoft Edge 80.0.361.109 Of 64 Bit version .
 Insert picture description here
(3) Download the corresponding version of the driver on the Microsoft official website .
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver
 Insert picture description here
(4) Click on “full version directory”, Enter a directory , Find the folder of the corresponding version , Then go in .
 Insert picture description here
(5) Download to the corresponding system driver file .
 Insert picture description here
(6) Download to local and extract , take msedgedriver.exe file rename by MicrosoftWebDriver.exe that will do .
 Insert picture description here
If you don't rename , stay RIDE The following errors may occur in :
INFO : Cannot capture screenshot because no browser is open.
FAIL : WebDriverException: Message: ‘MicrosoftWebDriver.exe’ executable needs to be in PATH. Please download from http://go.microsoft.com/fwlink/?LinkId=619687

The version MicrosoftWebDriver.exe Also put to Baidu network disk , Please download on demand .
link : https://pan.baidu.com/s/16sis-AqtzXEI968jU647ig Extraction code : leaf

(7) Deposit MicrosoftWebDriver
take MicrosoftWebDriver.exe Copied to the Python Can be installed under the directory .
And python.exe The storage location is the same .

Four 、IE browser

1.Internet Explorer Installation

because Windows10 Bring their own IE browser , So... Is not provided here IE How to download and install the browser .

2.IEDriverServer The download

(1) Start by opening IE browser
 Insert picture description here
(2) Click Settings -》Internet Options
 Insert picture description here
(3) Click on “ Security ”, take “Internet”、“ Local Intranet”、“ Trusted sites ”、“ Restricted sites ” Inside “ Enable protected mode ” Check all , Click ok , restart IE browser .
 Insert picture description here
If you don't do this , So in RIDE The following errors may occur in :
INFO : Cannot capture screenshot because no browser is open.
FAIL : SessionNotCreatedException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.

(4) see selenium edition
stay cmd Execute command in window
pip show selenium
 Insert picture description here
You can see , My current selenium Version is 3.141.0;

(5) download IEDriverServer
At present, it can be obtained from the following website IEDriverServer,
http://selenium-release.storage.googleapis.com/index.html
According to their own selenium edition , Select corresponding IEDriverServer Download , Find yourself selenium Version folder , Click in , Download on demand .
 Insert picture description here
 Insert picture description here
Download and unzip to get IEDriverServer.exe that will do .

(6) Deposit IEDriverServer
take IEDriverServer.exe Copied to the Python Can be installed under the directory .
And python.exe The storage location is the same .

3.IE Browser access xpath

(1) Tools used Fire-IEBrowser1.4.xlsm Has been put to our Baidu network disk link .
link : https://pan.baidu.com/s/16sis-AqtzXEI968jU647ig Extraction code : leaf
(2) With Excel Format open , Please enable macros , Click on Proceed.
(3) Input URL, Click on Load, If the bullet box , Click on “ yes ”.
(4) Want to click on the elements , Right click , Then enter any character , Click on “ determine ”.
(5) Close the macro window , We get what we want in the table xpath.
Refer to this article of the boss :
https://www.cnblogs.com/linbo3168/p/6553436.html

5、 ... and 、Opera browser

1.Opera Installation

(1) because Opera Slow download on official website , So it also provides the Baidu network disk link below .
link : https://pan.baidu.com/s/16sis-AqtzXEI968jU647ig Extraction code : leaf
(2) obtain OperaSetup.exe This document will do .
(3) Interested partners can also be in Opera Download on the official website .
https://www.opera.com/zh-cn
 Insert picture description here
(4) double-click OperaSetup.exe This file performs Opera Browser installation .
(5) Click on “ Options ”
 Insert picture description here
(6) Pay attention to every detail , Click on the install , Just wait for the installation to complete .
 Insert picture description here
matters needing attention
① The default language is “ chinese ( China )”
② The default installation method is “ All users on this computer ”
③ The default installation path is C disc Next , Default is not C Please install the disk in C Under this path :C:\Program Files\Opera
Remove your installation path before installation .
Can't delete , Please open the task manager to Opera Installer End of process .

If you don't follow the above steps , stay RIDE The following errors may occur when using :
( Please reinstall in this way after an error occurs )
INFO : Cannot capture screenshot because no browser is open.
FAIL : WebDriverException: Message: unknown error: cannot find Opera binary

2.operadriver The download

(1) First of all to see Opera Version of
open Opera browser , Click the red circle in the upper left corner .
 Insert picture description here
help -》 About Opera(A)
 Insert picture description here
 Insert picture description here
You can see , My current browser version is Opera Stable 67;

(2) download operadriver
At present, it can be downloaded from github Get to operadriver,
https://github.com/operasoftware/operachromiumdriver/releases
According to their own Opera edition , Select corresponding operadriver Download , Download and unzip to get operadriver.exe that will do .
 Insert picture description here
Of course , The previous Baidu network disk link also provides the corresponding version of this article operadriver.exe, Please download on demand .
link : https://pan.baidu.com/s/16sis-AqtzXEI968jU647ig Extraction code : leaf
(3) Deposit operadriver
take operadriver.exe Copied to the Python Can be installed under the directory .
And python.exe The storage location is the same .

3. change Opera The developer tool shortcut for is F12

Opera The default developer tool shortcut key for is Ctrl+Shift+I, Now let's make changes .
(1) Set up -》 senior -》 browser , Slide down , Find the shortcut key , Shortcut key -》 Configure shortcut keys , Then click on the triangle .
 Insert picture description here
(2) Slide down , find “ Developer tools ”, take Ctrl+Shift+I Delete , Click on Type a shortcut, Press down F12 that will do .
 Insert picture description here

6、 ... and 、 summary

browser Recommend index
Google Chrome9/10
Firefox6/10
Microsoft Edge8/10
Internet Explorer5/10
Opera7/10

Google Chrome is as easy to use as ever , The performance is the best .

7、 ... and 、 Colored eggs - lookup Python Installation directory

This article USES Windows10-64 Bit system , If the system is different, please Baidu by yourself .
1. The start menu , Find the letter P The first application , find Python Applications for .
 Insert picture description here
2. Right click Python Applications , Choose more -》 Open file location
 Insert picture description here
3. Now it's time to enter Python Directory of shortcuts to applications , Right click the shortcut , Click on “ Where to open the file ”
 Insert picture description here
4. Now it's time Python Installation directory of .
 Insert picture description here

disclaimer :
1. The purpose of writing this article is to learn better Selenium Use , If the interests of the people concerned are harmed , Please contact to delete ;
2. If the description is not right , Please correct in the comments ;
3. Writing is not easy , If it feels useful , Like collection will make bloggers happy ;
4. Besides , This article supports any form of reprint , Reprint please indicate the source , Thank you very much !!!
This article comes from :https://blog.csdn.net/testleaf/article/details/105302367
Blog Garden cnblogs Same number .

原网站

版权声明
本文为[testleaf]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221432571169.html