简体   繁体   English

我无法使用 python 在 selenium 中打开驱动程序(chrome/firefox)

[英]I was not able to open driver (chrome/firefox) in selenium using python

solution that i found was -> driver = webdriver.Chrome(executable_path='../drivers/chromedriver.exe')我找到的解决方案是-> driver = webdriver.Chrome(executable_path='../drivers/chromedriver.exe')

insert -- executable_path='' it will solve the problem as i was not able to comment on other posts, so i tried framing the question and share answers. insert -- executable_path=''它将解决问题,因为我无法对其他帖子发表评论,因此我尝试构建问题并分享答案。 Do let me know if anyone has any concern regarding this.如果有人对此有任何担忧,请告诉我。

  1. You have to Download Driver of Your Preference if you want to Download Chrome Driver then You should Visit This Site - https://chromedriver.chromium.org/downloads如果您想下载 Chrome 驱动程序,您必须下载您喜欢的驱动程序,然后您应该访问此站点 - https://chromedriver.chromium.org/downloads

and Also Check Your Chrome Version So that You Can Download an Eligible Driver.并检查您的 Chrome 版本,以便您可以下载符合条件的驱动程序。

  1. If you want to Download Firefox geeckodriver.exe then Visit -如果你想下载 Firefox geckodriver.exe 然后访问 -

https://github.com/mozilla/geckodriver/releases There in the Bottom You will Get the Download Link. https://github.com/mozilla/geckodriver/releases在底部您将获得下载链接。 According to Your Preferred Version Download One.根据您的首选版本下载一个。

Now When You Downloaded Your Favorite Driver go to Your Editor of Python and Import all Selenium thing and Write the code you Wrote above and make Sure you Executed these Drivers where you will be Executing the file in Python Editor Now When You Downloaded Your Favorite Driver go to Your Editor of Python and Import all Selenium thing and Write the code you Wrote above and make Sure you Executed these Drivers where you will be Executing the file in Python Editor

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM