Tor Browser with RSelenium in Linux/Windows

前端 未结 3 1429
攒了一身酷
攒了一身酷 2021-01-03 07:20

Looking to use RSelenium and Tor using my Linux machine to return the Tor IP (w/Firefox as Tor Browser). This is doable with Python, but having trouble with it in R. Can any

3条回答
  •  孤独总比滥情好
    2021-01-03 08:15

    This works in MacOS Sierra.

    First you need to configure both the Firefox and Tor browser Manual Proxy.

    Go to your Preferences>Advanced>Network>Settings

    Set SOCKS Host: 127.0.0.1 Port:9150 Check -> on SOCKS v5 in the browser menu bar.

    You will also need to have Tor Browser open whilst running the R script in Rstudio ....otherwise you will get a message in the firefox browser "The proxy server is refusing connections"

    You will also need to copy the name of your firefox profile in the script profile-name

    Open Finder and got to /Users/username/Library/Application Support/Firefox/Profiles/profile-name

    My R test script

     require(RSelenium)
    
        fprof <- getFirefoxProfile("/Users/**username**/Library/Application\ Support/Firefox/Profiles/nfqudbv2.default-1484451212373",useBase=TRUE)
    
        remDrv <- remoteDriver( browserName = "firefox"
                                , extraCapabilities = fprof)
    
        remDrv$open()
        remDrv$navigate("https://check.torproject.org/")
    

    This will open an instance of the Firefox browser with the message "Congratulations. This browser is configured to use Tor."

提交回复
热议问题