Traceback (most recent call last):
  File "C:\Users\nenuk\OneDrive\Desktop\Creator\32.py", line 556, in <module>
    driver = uc.Chrome(options=opts)
  File "C:\Users\nenuk\AppData\Local\Programs\Python\Python312\Lib\site-packages\undetected_chromedriver\__init__.py", line 258, in __init__
    self.patcher.auto()
  File "C:\Users\nenuk\AppData\Local\Programs\Python\Python312\Lib\site-packages\undetected_chromedriver\patcher.py", line 178, in auto
    self.unzip_package(self.fetch_package())
  File "C:\Users\nenuk\AppData\Local\Programs\Python\Python312\Lib\site-packages\undetected_chromedriver\patcher.py", line 287, in fetch_package
    return urlretrieve(download_url)[0]
  File "C:\Users\nenuk\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 240, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "C:\Users\nenuk\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\nenuk\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 521, in open
    response = meth(req, response)
  File "C:\Users\nenuk\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 630, in http_response
    response = self.parent.error(
  File "C:\Users\nenuk\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 559, in error
    return self._call_chain(*args)
  File "C:\Users\nenuk\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 492, in _call_chain
    result = func(*args)
  File "C:\Users\nenuk\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 639, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

我如何才能解决这个问题,上次我重新下载了一切,但现在它没有.

推荐答案

    def fetch_package(self):
    """
    Downloads ChromeDriver from source

    :return: path to downloaded file
    """
    zip_name = f"chromedriver_{self.platform_name}.zip"
    if self.is_old_chromedriver:
        download_url = "%s/%s/%s" % (self.url_repo, self.version_full.vstring, zip_name)
    else:
        zip_name = zip_name.replace("_", "-", 1)
        #download_url = "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/%s/%s/%s"
        download_url = "https://storage.googleapis.com/chrome-for-testing-public/%s/%s/%s"
        download_url %= (self.version_full.vstring, self.platform_name, zip_name)

    logger.debug("downloading from %s" % download_url)
    return urlretrieve(download_url)[0]

您需要将FETCH_PACKAGE(SELF)更改为unDetected_chromedrive\patcher.py

由于旧的下载URL无法获得Chrome驱动程序,您应该使用‘https://storage.googleapis.com/’来替换‘https://edgedl.me.gvt1.com/edgedl/chrome/’.

Python相关问答推荐

Python:在类对象内的字典中更改所有键的索引,而不是仅更改一个键

更改matplotlib彩色条的字体并勾选标签?

Pandas 在最近的日期合并,考虑到破产

替换字符串中的多个重叠子字符串

. str.替换pandas.series的方法未按预期工作

无法使用DBFS File API路径附加到CSV In Datricks(OSError Errno 95操作不支持)

有没有一种方法可以从python的pussompy比较结果中提取文本?

不能使用Gekko方程'

Pandas GroupBy可以分成两个盒子吗?

使用Python查找、替换和调整PDF中的图像'

在极中解析带有数字和SI前缀的字符串

如何在两列上groupBy,并使用pyspark计算每个分组列的平均总价值

如何合并具有相同元素的 torch 矩阵的行?

使用嵌套对象字段的Qdrant过滤

获取PANDA GROUP BY转换中的组的名称

为罕见情况下的回退None值键入

Python如何导入类的实例

如何防止html代码出现在quarto gfm报告中的pandas表之上

用由数据帧的相应元素形成的列表的函数来替换列的行中的值

高效地计算数字数组中三行上三个点之间的Angular