-wenli

安装chrome

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
yum install ./google-chrome-stable_current_x86_64.rpm
yum install mesa-libOSMesa-devel gnu-free-sans-fonts wqy-zenhei-fonts

安装chromedriver

wget http://npm.taobao.org/mirrors/chromedriver/2.41/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
mv chromedriver /usr/bin/
chmod +x /usr/bin/chromedriver

Python脚本快速测试

from selenium.webdriver.chrome.options import Options
from selenium import webdriver
chrome_options = Options()

chrome_options.add_argument(\'--no-sandbox\')
chrome_options.add_argument(\'--disable-dev-shm-usage\')
chrome_options.add_argument(\'blink-settings=imagesEnabled=false\')
chrome_options.add_argument(\'--headless\')

driver = webdriver.Chrome(chrome_options=chrome_options)
driver.get(\'https://www.baidu.com\')
print driver.page_source
print driver.title

 

 

分类:

技术点:

相关文章:

  • 2021-12-03
  • 2021-11-15
  • 2022-12-23
  • 2021-11-17
  • 2022-01-12
  • 2022-01-05
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2021-11-24
  • 2021-06-25
  • 2022-01-25
  • 2022-12-23
  • 2021-12-29
相关资源
相似解决方案