相关疑难解决方法(0)

如何通过 Python 使用 GeckoDriver 和 Firefox 使 Selenium 脚本无法检测?

有没有办法使用geckodriver使您的 Selenium 脚本在 Python 中无法检测到

我正在使用 Selenium 进行抓取。我们是否需要使用任何保护措施使网站无法检测到 Selenium?

python firefox selenium selenium-firefoxdriver geckodriver

15
推荐指数
2
解决办法
1万
查看次数

如何使用Python连接到Tor浏览器

我正在尝试连接到Tor浏览器,但收到一条错误消息,指出“ proxyConnectFailure”,我尝试了多次尝试以了解Tor浏览器的基础知识以实现连接的任何想法,但如果有什么话可以挽救生命,那一切都是徒劳的:

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


binary = FirefoxBinary(r"C:\Users\Admin\Desktop\Tor Browser\Browser\firefox.exe")
profile = FirefoxProfile(r"C:\Users\Admin\Desktop\Tor Browser\Browser\TorBrowser\Data\Browser\profile.default")

# Configured profile settings.

proxyIP = "127.0.0.1"
proxyPort = 9150

proxy_settings = {"network.proxy.type":1,
    "network.proxy.socks": proxyIP,
    "network.proxy.socks_port": proxyPort,
    "network.proxy.socks_remote_dns": True,
}
driver = webdriver.Firefox(firefox_binary=binary,proxy=proxy_settings)

def interactWithSite(driver):

    driver.get("https://www.google.com")    
    driver.save_screenshot("screenshot.png")

interactWithSite(driver)
Run Code Online (Sandbox Code Playgroud)

python proxy selenium tor firefox-profile

3
推荐指数
1
解决办法
1139
查看次数