Use python Or other programming languages , do ui/web Browser automation ( test ) when , Some configuration is needed .
1, browser ; Since we do it web automation , You definitely need a browser , In general use Google / firefox .
2, install web driver drive . Because I use Google browser , What's installed here is chrome driver drive .
2.1 Download the installation address ( Unofficial address , Domestic mirror address ):https://registry.npmmirror.com/binary.html
2.2 Find the corresponding directory , Click to enter
Be careful :web driver The version of the driver needs to be compatible with the browser , Generally, it is version correspondence .
2.3 For example, I check the current chrome The version of the browser is 103.0.5060.xxxx
2.4 Find the corresponding version to download , After clicking , Go to the next level
2.5 After entering the next level , You can see the corresponding drive system of this version . My computer is Windows, So download win32 That's all right. (64 Bit and 32 Bit Download win32 that will do )
2.6 After downloading to local , yes .zip The compressed file of , Just unzip it normally . After decompressing , Put the driver under the project directory that needs to be run , Because of the need to use .
3, Download the language binding package , stay pycharm Run the command inside :pip install selenium
4, Then you can go through python Run the driver browser .
4.1 I opened Baidu's website here .