概述
from selenium import webdriver
from selenium.webdriver import ChromeOptions
url = 'https://kjt.hebei.gov.cn/www/xwzx15/hbkjdt64/3ab0c4a6-1.html'
option = ChromeOptions()
ip = get_procxy()
option.add_argument(('--proxy-server=' + ip['https'].split('/')[
-1]))
# option.add_argument('--headless')
prefs = {"profile.managed_default_content_settings.images": 2}
option.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(chrome_options=option)
driver.get(url=url)
rsp = driver.execute_script("return document.documentElement.outerHTML")
最后
以上就是负责鱼为你收集整理的selenium挂代理+不加载图片(提速)的全部内容,希望文章能够帮你解决selenium挂代理+不加载图片(提速)所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复