1. Install google-chrome browser linux version
Install chrome
Install Google Chrome with the following command
yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
You can also download it locally first and then install it
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
yum install ./google-chrome-stable_current_x86_64.rpm
Install necessary libraries
yum install mesa-libOSMesa-devel gnu-free-sans-fonts wqy-zenhei-fonts
2. Download chromedriver
Download address: http://npm.taobao.org/mirrors/chromedriver/ ,
Please select the chromedriver corresponding to the chrome version you installed
Query the version of linux installation, and then download the corresponding linux version
google-chrome -version
3. Place chromedriver in the specified directory and start it
Place chromedriver in the directory configured in your java project and start it
Start command: chmod a+x chromedriver
Configuration of code in java
4.Maven packages the java project and executes it on linux