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

        <small id='cLseD'></small><noframes id='cLseD'>

      1. <legend id='cLseD'><style id='cLseD'><dir id='cLseD'><q id='cLseD'></q></dir></style></legend>

        Mac 上 Python 中的 Selenium - Geckodriver 可执行文件需要在 PATH 中

        时间:2023-07-05
        1. <i id='s1ng3'><tr id='s1ng3'><dt id='s1ng3'><q id='s1ng3'><span id='s1ng3'><b id='s1ng3'><form id='s1ng3'><ins id='s1ng3'></ins><ul id='s1ng3'></ul><sub id='s1ng3'></sub></form><legend id='s1ng3'></legend><bdo id='s1ng3'><pre id='s1ng3'><center id='s1ng3'></center></pre></bdo></b><th id='s1ng3'></th></span></q></dt></tr></i><div id='s1ng3'><tfoot id='s1ng3'></tfoot><dl id='s1ng3'><fieldset id='s1ng3'></fieldset></dl></div>

            <legend id='s1ng3'><style id='s1ng3'><dir id='s1ng3'><q id='s1ng3'></q></dir></style></legend>

              <small id='s1ng3'></small><noframes id='s1ng3'>

                <bdo id='s1ng3'></bdo><ul id='s1ng3'></ul>
                  <tbody id='s1ng3'></tbody>
              • <tfoot id='s1ng3'></tfoot>

                • 本文介绍了Mac 上 Python 中的 Selenium - Geckodriver 可执行文件需要在 PATH 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我是编程新手,大约 2 个月前开始使用 Python,现在正在阅读 Sweigart 的 Automate the Boring Stuff with Python text.我正在使用 Spyder 3 并且已经安装了 selenium 模块和 Firefox 浏览器.我在python文件中使用了以下代码

                  I'm new to programming and started with Python about 2 months ago and am going over Sweigart's Automate the Boring Stuff with Python text. I'm using Spyder 3 and already installed the selenium module and the Firefox browser. I used the following code in python file

                  from selenium import webdriver
                  browser = webdriver.Firefox()
                  browser.get('http://inventwithpython.com')
                  

                  我收到此错误:

                  Message: 'geckodriver' executable needs to be in PATH.
                  

                  除了进入终端并使用安装它之外,我还下载了 geckodriver.exe

                  I've downloaded geckodriver.exe in addition to going into terminal and installing it using

                  brew install geckodriver
                  

                  奇怪的是,如果我进入终端并输入python",然后将代码放入,它可以工作,但当我在 Spyder 中运行文件时却不行.我需要将 geckodriver.exe 文件放在哪里才能正常工作?我尝试将它放在各种文件夹中(与 python 文件相同的文件夹,与 webdriver 文件相同的文件夹,在用户 bin 中,等等),但我得到了同样的错误

                  Oddly enough, if I go into terminal and type "python" and then put the code in, it works, but not when I run the file in Spyder. Where do I need to put the geckodriver.exe file for it to work? I've tried putting it in various folders (same folder as the python file, same folder as the webdriver file, in the user bin, and so on) but I get the same error

                  我查看了类似的问题,但似乎找不到有效的方法.我也尝试过使用 Chrome,但使用 chromedriver 时出现同样的错误.

                  I've looked at similar questions but can't seem to find something that works. I've also tried with Chrome but I get the same error but with chromedriver.

                  which geckodriver
                  

                  产生 /usr/local/bin/geckodriver

                  我也在 Mac 上,所以文件路径对我来说比在 Windows 上要困难一些.

                  I'm also on a Mac, so file paths are a little more difficult for me than on windows.

                  推荐答案

                  已解决:我将 geckodriver exe 放在/Users/sethkillian/anaconda/bin 中,现在它可以在 Spyder 上正常运行.感谢您的帮助!

                  SOLVED: I placed the geckodriver exe in /Users/sethkillian/anaconda/bin and now it works from Spyder with no problem. Thanks for the help!

                  这篇关于Mac 上 Python 中的 Selenium - Geckodriver 可执行文件需要在 PATH 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:让 Chrome 通过 Selenium 启动 下一篇:不支持的命令行标志:--ignore-certificate-errors

                  相关文章

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

                      <small id='HrdwL'></small><noframes id='HrdwL'>

                      <legend id='HrdwL'><style id='HrdwL'><dir id='HrdwL'><q id='HrdwL'></q></dir></style></legend>