python怎样使用linux驱动_Python+Selenium+Chrome+ChromeDriver(Linux环境篇)

1, CentOS

2, Python3

3, Pip3

4, 代码增加实例化配置,并确执行结束后quit掉实例

chrome_options = Options()

chrome_options.add_argument('--headless')

chrome_options.add_argument('--no-sandbox')

chrome_options.add_argument('--disable-dev-shm-usage')

driver = webdriver.Chrome('/path/to/your_chrome_driver_dir/chromedriver',options=chrome_options)

cd /usr/local/share

unzip chromedriver_linux64.zip

chmod +x chromedriver

ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver

ln -s /usr/local/share/chromedriver /usr/bin/chromedriver

6, 查看版本

chromedriver --version

7, 安装chrome

yum install chromium

8, 安装依赖

yum install GConf2

你可能感兴趣的:(python怎样使用linux驱动_Python+Selenium+Chrome+ChromeDriver(Linux环境篇))