Using Selenium WebDriver with Tor

后端 未结 5 895
走了就别回头了
走了就别回头了 2020-11-30 03:12

Because Tor Browser Bundle is just a patched version of Firefox, it seems that it should be possible to use a FirefoxDriver with Tor Browser. This is what I\'ve

5条回答
  •  自闭症患者
    2020-11-30 04:04

    If you mostly care about remote-controlling a browser using Tor (and would maybe prefer to use the Tor Browser instead of vanilla Firefox), you can use Mozilla's Marionette. Use like

    To use with the Tor Browser, enable marionette at startup via

    Browser/firefox -marionette
    

    (inside the bundle). Then, you can connect via

    from marionette import Marionette
    client = Marionette('localhost', port=2828);
    client.start_session()
    

    and load a new page for example via

    url='http://mozilla.org'
    client.navigate(url);
    

    For more examples, there is a tutorial along with more documentation.

    (copy)

提交回复
热议问题