兰州新站点seo加盟,迎访问中国建设银行网站-,散文古诗网站建设目标,wordpress 插件 无法创建目录使用前#xff0c;首先打开socks5全局代理。 之前我还写过一篇关于编程中使用到代理的情况#xff1a;
记录一下python编程中需要使用代理的解决方法_python 使用全局代理_小小爬虾的博客-CSDN博客
在本文中#xff0c;首先安装selenium和安装chrome浏览器。
参考我的文章…使用前首先打开socks5全局代理。 之前我还写过一篇关于编程中使用到代理的情况
记录一下python编程中需要使用代理的解决方法_python 使用全局代理_小小爬虾的博客-CSDN博客
在本文中首先安装selenium和安装chrome浏览器。
参考我的文章python3如何安装各类库的小总结_小小爬虾的博客-CSDN博客
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time#socks代理
host127.0.0.1
port10808
chrome_options Options()
chrome_options.add_argument(--proxy-serversocks5:// host : port)# driver webdriver.Chrome(chrome_optionschrome_options)#低版本的selenium使用的是chrome_optionschrome_options
driver webdriver.Chrome(optionschrome_options)#高版本的selenium使用的是optionschrome_options
url https://www.google.com
driver.maximize_window() #浏览器最大化
driver.get(url)
time.sleep(10)
那么如何查看selenium的版本呢?
1、运行cmd进入到pip3.exe的路径
cd C:\Users\LC\AppData\Local\Programs\Python\Python310\Scripts
2、在路径下运行pip3.exe show selenium