基本環境:centos7,python3.x
pip3 install seleniumhtml
wget https://dl.google.com/linux/d... --no-check-certificate
yum install ./google-chrome-stable_current_x86_64.rpmpython
wget http://chromedriver.storage.g...
解壓此文件,並將文件移動到/usr/bin目錄下
unzip chromedriver_linx64.zip
mv chromedriver /usr/bin/linux
python3 test.pyweb
from selenium import webdriver
url='http://bing.com'
option = webdriver.ChromeOptions()
option.add_argument('--no-sandbox')
option.add_argument('--headless')
driver = webdriver.Chrome(chrome_options=option)
driver.get(url)
print(driver.page_source)chrome