• <legend id='YecIr'><style id='YecIr'><dir id='YecIr'><q id='YecIr'></q></dir></style></legend>

  • <i id='YecIr'><tr id='YecIr'><dt id='YecIr'><q id='YecIr'><span id='YecIr'><b id='YecIr'><form id='YecIr'><ins id='YecIr'></ins><ul id='YecIr'></ul><sub id='YecIr'></sub></form><legend id='YecIr'></legend><bdo id='YecIr'><pre id='YecIr'><center id='YecIr'></center></pre></bdo></b><th id='YecIr'></th></span></q></dt></tr></i><div id='YecIr'><tfoot id='YecIr'></tfoot><dl id='YecIr'><fieldset id='YecIr'></fieldset></dl></div>
    <tfoot id='YecIr'></tfoot>

          <bdo id='YecIr'></bdo><ul id='YecIr'></ul>

      1. <small id='YecIr'></small><noframes id='YecIr'>

        使用 Selenium WebDriver 运行 TOR 浏览器

        时间:2023-07-13
          <tbody id='UkVNL'></tbody>

        1. <tfoot id='UkVNL'></tfoot>
            <i id='UkVNL'><tr id='UkVNL'><dt id='UkVNL'><q id='UkVNL'><span id='UkVNL'><b id='UkVNL'><form id='UkVNL'><ins id='UkVNL'></ins><ul id='UkVNL'></ul><sub id='UkVNL'></sub></form><legend id='UkVNL'></legend><bdo id='UkVNL'><pre id='UkVNL'><center id='UkVNL'></center></pre></bdo></b><th id='UkVNL'></th></span></q></dt></tr></i><div id='UkVNL'><tfoot id='UkVNL'></tfoot><dl id='UkVNL'><fieldset id='UkVNL'></fieldset></dl></div>
            <legend id='UkVNL'><style id='UkVNL'><dir id='UkVNL'><q id='UkVNL'></q></dir></style></legend>
            • <small id='UkVNL'></small><noframes id='UkVNL'>

                <bdo id='UkVNL'></bdo><ul id='UkVNL'></ul>

                  本文介绍了使用 Selenium WebDriver 运行 TOR 浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我目前正在尝试使用 Selenium WebDriver (JAVA) 2.53 和 Firefox 43.0 执行 TOR 6.0.4.我已按照这篇文章中的说明操作 Using Selenium WebDriver with Tor 但我得到了一个将 TOR 的 profilePath 加载到 Firefox 二进制文件时出错.我已经看到可以通过将 TOR profile.default 存档加载到 firefox binaty 来为 TOR 提供午餐,但是在使用配置文件实例化二进制文件时,我得到了一个驱动程序信息:driver.version:unknown.我已经尝试更改Firefox版本并且仍然如此.在我启动驱动程序的代码下方.我也在使用 Windows.

                  Im currently trying to execute TOR 6.0.4 with Selenium WebDriver (JAVA) 2.53 and Firefox 43.0. I've followed the instructions from this post Using Selenium WebDriver with Tor but Im getting an error while loading the profilePath of TOR to the Firefox Binary. I've seen that is possible to lunch TOR by loading the TOR profile.default archive to the firefox binaty, but Im getting a Driver info: driver.version: unknown, when instantiating the binary with the profile. I've tried to change the firefox version and still. Below the code where I start the driver. Im also using Windows.

                   String torPath = "C:\Users\Jose Bernhardt\Desktop\Tor Browser\Start Tor Browser.exe";
                      String profilePath = "C:\Users\Jose Bernhardt\Desktop\Tor Browser\Browser\TorBrowser\Data\Browser\profile.default";
                  
                      File torProfileDir = new File(profilePath);
                      FirefoxBinary binary = new FirefoxBinary(new File(torPath));
                      FirefoxProfile torProfile = new FirefoxProfile(torProfileDir);
                      FirefoxDriver driver = new FirefoxDriver();
                      driver.get("http://www.google.com/webhp?complete=1&hl=en");
                  

                  查看下面抛出的异常:

                  Exception in thread "main" org.openqa.selenium.WebDriverException: Specified firefox binary location does not exist or is not a real file: C:UsersJose BernhardtDesktopTor BrowserStart Tor Browser.exe
                  

                  推荐答案

                  似乎我正在加载 Tor.exe,而我不得不从 Tor 存档中加载 firefox.exe.我改变了我的路径并且正在工作.还修复了我没有将配置文件和二进制文件发送到驱动程序构造函数

                  Seems that I was loading the Tor.exe and instead I had to load the firefox.exe from the Tor archive. I change my path to this and is working. Also fix that I was not sending the profile and the binary to the driver constructor

                   "C:\Users\Jose Bernhardt\Desktop\Tor Browser\Browser\firefox.exe"
                  FirefoxDriver driver = new FirefoxDriver(binary, torProfile);
                  

                  这篇关于使用 Selenium WebDriver 运行 TOR 浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Java Selenium:如何在不先加载页面的情况下获取网页的 HTML? 下一篇:Selenium IEServerDriver 找不到 IE9 的新窗口

                  相关文章

                1. <tfoot id='5CclM'></tfoot>

                  <i id='5CclM'><tr id='5CclM'><dt id='5CclM'><q id='5CclM'><span id='5CclM'><b id='5CclM'><form id='5CclM'><ins id='5CclM'></ins><ul id='5CclM'></ul><sub id='5CclM'></sub></form><legend id='5CclM'></legend><bdo id='5CclM'><pre id='5CclM'><center id='5CclM'></center></pre></bdo></b><th id='5CclM'></th></span></q></dt></tr></i><div id='5CclM'><tfoot id='5CclM'></tfoot><dl id='5CclM'><fieldset id='5CclM'></fieldset></dl></div>

                      <legend id='5CclM'><style id='5CclM'><dir id='5CclM'><q id='5CclM'></q></dir></style></legend>

                      • <bdo id='5CclM'></bdo><ul id='5CclM'></ul>

                      <small id='5CclM'></small><noframes id='5CclM'>