python - 如何解决这个 selenium-chromedriver 错误?
问题描述
我做了一个代码
from bs4 import BeautifulSoup
from selenium import webdriver
from urllib.request import urlopen
from urllib.parse import quote_plus
import time
url1 = "https://www.instagram.com/explore/tags/"
url2 = input("write a hashtag : ")
url = url1 + quote_plus(url2)
driver = webdriver.Chrome('executable_path=r"C:\Chrome\chromedriver.exe"')
driver.get(url)
我收到一条错误消息
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 947, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1819, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver'
我已经安装了 chromedriver 并想知道如何使新的 chrome 页面出现任何评论将不胜感激
解决方案
推荐阅读
- c# - 一行或一列中没有 3 个相同的随机 2D 数组
- c# - 如何将条件等于两个字符串
- python - 随机 url 生成器,但确保结果是唯一的
- python - 熊猫将(不等长度)列表的列拆分为多列
- python - Youtube V3 API 不对视频进行排序
- azure-devops - 将管道变量从 Designer 传递到 YAML 作业模板
- node.js - 有没有办法使用多个优先路径来保存 pug 文件?
- db2-400 - 在 QSYS2 中使用函数 TIMESTAMP_FORMAT 无效。成员数据映射错误
- java - kotlin-jpa 插件不生成默认构造函数
- jquery - 未捕获的 SyntaxError:意外的标识符和意外的令牌