Install Google without interface
1. Install chrome on the command line of Ubuntu server version
sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb # Might show "errors", fixed by next line
sudo apt-get install -f
google-chrome --version # check the version
2. Drivers of different browsers
Chrome:https://sites.google.com/a/chromium.org/chromedriver/downloads
Firefox:https://github.com/mozilla/geckodriver/releases
Edge:https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Safari:https://webkit.org/blog/6900/webdriver-support-in-safari-10/
3. Test whether the installation is successful
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('--no-sandbox')
client = webdriver.Chrome(chrome_options=chrome_options, executable_path='your path')
client.get("https://www.baidu.com")
print (client.page_source.encode('utf-8'))
client.quit()
4. Error in running selenium, permission denied. Add executable permissions to driver files
。
command: sudo chmod +x chromedriver
Read More:
- How to Solve labelme Install Error in Ubuntu
- How to Solve Xmind Install Error in Ubuntu System
- How to Solve Mujoco Install Error in Ubuntu (Pycharm Run Error)
- mysqlclient in Ubuntu: How to Solve mysqlclient Install Error
- Install and start the tftp-server server and possible solutions to Redirecting to /bin/systemctl restart xinetd.service problems
- Ubuntu18.04 Install ROS Error: rosdep update [How to Solve]
- How to Fix Ubuntu(Linux) mount error(22)
- How to Uncompress 7z files on Ubuntu, Debian, Fedora
- [Solved] Ubuntu 20.04 install MATLAB and toolbox permissions Error
- [Solved] Ubuntu 20.04.3 Fail to Start sshd Error: Failed to start OpenBSD Secure Shell server
- [Solved] Ubuntu20.04 Error: “Failed to install the following Android SDK packages as some licences have not..“error
- How to Solve Ubuntu “Failed to fetch” Error
- Ubuntu 20.04 Desktop Install sublime-text Error: “Certificate verification failed”
- [Solved] Ubuntu pip Install Error: which is not on PATH
- [Solved] Ubuntu Server 18.4 System /etc/sudoers: syntax error near line 32
- Ubuntu Error: dpkg: error processing package mysql-community-server (–configure):
- [Solved] Ubuntu16.4Install vcs2016 Error: mount.vboxsf: mounting failed with the error: Invalid argument
- Ubuntu20.04 install the ROS noetic version in catkin_Problems in make compilation
- ubuntu install package Error: subprocess installed post-installation script returned error exit status 10
- How to Solve Ubuntu20.04 Compile Error:error while loading shared libraries: libncurses.so.5