I
I
Ilya123452021-07-14 11:02:37
PHP
Ilya12345, 2021-07-14 11:02:37

Tor + PHP + Selenium?

Good day, how to use Tor proxy with Sleenium + PHP?
Found the code in Python:

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)

But since I'm a little boom-boom in Python, I don't really understand how to use it in PHP.
How many examples googled, finds on everything except PHP.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nokimaro, 2021-07-15
@nokimaro

https://github.com/php-webdriver/php-webdriver/wiki...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question