python - 无法通过代理链运行 selenium python 脚本
问题描述
简介 我使用 Python3 制作了一个小脚本,可以打开 gecko webdriver 并打开任何网站。然后我添加了一些其他功能,比如循环打开窗口多次。
错误 脚本在正常运行时工作,使用:
Python3 运行.py
但是,当使用代理链运行同样的事情时,我收到错误“拒绝”。下面的所有脚本逻辑和错误消息..
脚本 - 运行
driver = webdriver.Firefox(firefox_profile=profile)
driver.get("https://www.youtube.com/")
time.sleep(delay_time)
driver.close()
脚本 - 旋转
for x in range(rotations):
print(f"Session: {x} started")
run_driver(delay) # function for running driver
代理链错误
ProxyChains-3.1 (http://proxychains.sf.net)
Loading useragent file ..
Session: 0 started
|R-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:46985-<--denied
|R-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:46985-<--denied
|DNS-request| localhost
|R-chain|-<>-127.0.0.1:9050-<><>-4.2.2.2:53-<><>-OK
|DNS-response| localhost is 127.0.0.1
|R-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:46985-<--denied
|DNS-request| localhost
|R-chain|-<>-127.0.0.1:9050-<><>-4.2.2.2:53-<><>-OK
|DNS-response| localhost is 127.0.0.1
|R-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:46985-<--denied
|DNS-request| localhost
|R-chain|-<>-127.0.0.1:9050-<><>-4.2.2.2:53-<><>-OK
|DNS-response| localhost is 127.0.0.1
|R-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:46985-<--denied
|DNS-request| localhost
|R-chain|-<>-127.0.0.1:9050-<><>-4.2.2.2:53-<><>-OK
|DNS-response| localhost is 127.0.0.1
|R-chain|-<>-127.0.0.1:9050-<><>-127.0.0.1:46985-<--denied
^Z
[1]+ Stopped proxychains python3 run.py --num 1 --delay 1 --ripper 0
任何帮助表示赞赏。谢谢你。
解决方案
推荐阅读
- maven - 使用 maven 编译范围时 jar 中缺少依赖类
- r - 如何在 GAMM 中测试随机效应的统计显着性?
- visual-studio-code - 从命令行列出 VS Code 最近的工作区
- firebase - 如何在 Firestore 云功能中使用通配符?
- linux - 根据列中的值有条件地复制表格数据文件的行
- c# - 在 Gridview 中显示数据库
- c - 链表并按字母顺序排序
- javascript - 在计算中包含字符串时 Python 中的错误
- git - git diff --numstat windows 和 ubuntu 上的不同格式
- c# - 从命令操作中更新 UI 元素