# -*- coding:utf-8 -*-
from selenium import webdriver

'''
设置页面不加载图片,这样可以加快页面的渲染,减少爬虫的等待时间,提升爬取效率
固定配置如下:
'''
chrome_opt = webdriver.ChromeOptions()
prefs = {'profile.managed_default_content_settings.images': 2}
chrome_opt.add_experimental_option('prefs',prefs)

# webdriver.Chrome(executable_path='path')启动失败的话,可以指定ChromeDriver驱动的位置path路径
browser = webdriver.Chrome(chrome_options=chrome_opt)

# 启动淘宝测试结果
browser.get('https://www.taobao.com')

 

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2022-01-06
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-30
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案