简体   繁体   English

如何防止在浏览网站期间更改我的 ip

[英]How I can prevent to change my ip during browse the website by usening selenium pyhthon firefox

ther is my code when i visit this site ( https://www.myip.com/ ) and after 1 minute refresh the site my ip will change, my question is How I can prevent to change my ip during browse the website by usening selenium pyhthon firefox这是我访问此站点时的代码( https://www.myip.com/ ),刷新站点 1 分钟后,我的 ip 将发生变化,我的问题是如何防止在浏览网站时更改我的 Z957B527BCFBAD8 使用 932E80F58D20 selenium 蟒蛇 firefox

import os
import time

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver import FirefoxProfile
from selenium import webdriver

torexe = os.popen(r'C:\Users\sam\OneDrive\Desktop\Tor Browser\Browser\firefox.exe')

time.sleep(5)
binary = FirefoxBinary(r"C:\Users\sam\OneDrive\Desktop\Tor Browser\Browser\firefox.exe")
profile = FirefoxProfile(r"C:\Users\sam\OneDrive\Desktop\Tor Browser\Browser\TorBrowser\Data\Browser\profile.default")
profile.set_preference('network.proxy.type', 1)
profile.set_preference('network.proxy.socks', '127.0.0.1')
profile.set_preference('network.proxy.socks_port', 9150)
profile.update_preferences()
firefox_options = webdriver.FirefoxOptions()
driver = webdriver.Firefox(profile, binary)
driver.get("https://www.google.com/")

#driver.quit()

The answer is: You can't答案是:你不能
Selemium is definitely not a tool for such a things. Selemium绝对不是这样的工具。
Your question is like: "What T-shirt should I wear in order to prevent the https://www.myip.com/ from changing my PC IP address"?您的问题是:“我应该穿什么 T 恤以防止https://www.myip.com/更改我的 PC IP 地址”?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 selenium WebDriver Chrome 更改我的 IP - How can I change my IP using selenium WebDriver Chrome 如何使用selenium浏览整个网站? - How to browse a whole website using selenium? 如何用selenium在firefox中禁用javascript? - How can I disable javascript in firefox with selenium? 如何在尝试抓取网站时更改我的位置? - how can I change my location while trying to scrape the website? 如何将 cookies 保存到 Selenium Python 中的 Firefox 配置文件中,然后在接下来的 session 中再次加载它们? - How can I save cookies to my Firefox Profile in Selenium Python and load them in again next session? 我该如何使Selenium使用我的firefox(而不是创建新的) - How can I make Selenium use my firefox (not create a fresh one) 如何防止我的网站遭到“骚扰”? - How can I prevent my website from being “hit-boosted”? 如何更改selenium中的IP地址? - How to change the IP address in selenium? 亚马逊网站显示“送至国家/地区”。 如何在 Python Selenium 中以编程方式更改它以截取屏幕截图 - Amazon website shows "Deliver to Country". How can I change it programmatically in Python Selenium to take screenshots 如何设置Selenium以使用多个Firefox配置文件? - How can I set up Selenium to use multiple Firefox profiles?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM