小编Bla*_*ole的帖子

Selenium geckodriver:配置文件丢失:无法加载您的 Firefox 配置文件

我在以下代码中使用 geckodriver:

import time
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
url = 'https://www.idealista.com/venta-viviendas/barcelona/eixample/la-dreta-de-l-eixample/?ordenado-por=fecha-publicacion-desc'
options = Options()
options.headless = False
driver = webdriver.Firefox(options=options, executable_path='/home/kevin/Desktop/Inmosoft/geckodriver')
driver.get(url)
time.sleep(10)
Run Code Online (Sandbox Code Playgroud)

但每次我尝试执行时都会出现此错误:

在此输入图像描述

我尝试按照此链接https://support.mozilla.org/en-US/kb/how-run-firefox-when-profile-missing-inaccessiblefirefox -P中的信息在 Firefox 中创建另一个配置文件。

看起来 geckodriver 与 firefox 是一个完全不同的实例,并且它不使用相同的配置文件,我如何在使用 geckodriver 时绕过此错误并创建配置文件?

python selenium geckodriver

25
推荐指数
3
解决办法
2万
查看次数

标签 统计

geckodriver ×1

python ×1

selenium ×1