<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 中

        Selenium in Python on Mac - Geckodriver executable needs to be in PATH(Mac 上 Python 中的 Selenium - Geckodriver 可执行文件需要在 PATH 中)
        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 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  env: python: No such file or directory(env: python: 没有这样的文件或目录)
                  How to evaluate environment variables into a string in Python?(如何在 Python 中将环境变量评估为字符串?)
                  Python - temporarily modify the current process#39;s environment(Python - 临时修改当前进程的环境)
                  Change current process environment#39;s LD_LIBRARY_PATH(更改当前进程环境的 LD_LIBRARY_PATH)
                  Reading and writing environment variables in Python?(在 Python 中读写环境变量?)
                  When to use sys.path.append and when modifying %PYTHONPATH% is enough(何时使用 sys.path.append 以及何时修改 %PYTHONPATH% 就足够了)
                    • <bdo id='HrdwL'></bdo><ul id='HrdwL'></ul>
                        <tbody id='HrdwL'></tbody>

                    • <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>