Centos7安 装python3+Selenium+chrome+chromedriver (2)

options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument('--no-sandbox')
driver = webdriver.Chrome(executable_path="/root/test/chromedriver", chrome_options=options)
driver.get("https://www.baidu.com")
print(driver.page_source)
driver.quit()

 

借鉴https://blog.csdn.net/lizhou828/article/details/102954993

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wsszgj.html