from selenium import webdriver
from time import sleep
#无头浏览器引入模块
from selenium.webdriver.chrome.options import Options
#无头浏览器设置
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
#无头浏览器增加属性options=chrome_options
bro = webdriver.Chrome(executable_path='I:\chromedriver_win32\chromedriver_win32\chromedriver',options=chrome_options)
bro.get('https://qzone.qq.com/')
sleep(2)
print(bro.page_source)
selenium无头浏览器配置教程
最新推荐文章于 2024-09-15 10:30:00 发布