我在以下代码中使用 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 时绕过此错误并创建配置文件?