Estou usando o databricks e não consigo usar o undetected_geckodriver já instalei o firefox e outras configurações mas não funcionou. Copiei o Firefox para um dos caminhos que o undetected_geckodriver pesquisa mas com este novo erro





!wget https://archive.mozilla.org/pub/firefox/releases/99.0b8/linux-x86_64/en-US/firefox-99.0b8.tar.bz2
!tar -xjf firefox-99.0b8.tar.bz2
!sudo mv firefox /opt/firefox-99.0b8
!sudo ln -s /opt/firefox-99.0b8/firefox /usr/bin/firefox
!sudo apt update
!sudo apt install libdbus-glib-1-2


!firefox --version

!wget https://github.com/mozilla/geckodriver/releases/download/v0.35.0/geckodriver-v0.35.0-linux64.tar.gz

!tar -xvzf geckodriver-v0.35.0-linux64.tar.gz
!sudo mv geckodriver /usr/local/bin/

!pip install selenium pyvirtualdisplay undetected-geckodriver


! pip install typing-extensions==4.7.1
dbutils.library.restartPython()


!cp /usr/bin/firefox /usr/lib/firefox/firefox



import os

user = 'herick.fr226@hotmail.com' 
os.environ['USER'] = user
# Monkey-patch os.getlogin to return a default value
os.getlogin = lambda: user



!sudo apt-get install -y libgtk-3-0 libdbus-glib-1-2 libxt6


from undetected_geckodriver import Firefox
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from selenium.webdriver.firefox.service import Service
from pyvirtualdisplay import Display
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.by import By

display_ = Display(visible=0, size=(1400, 900))
display_.start()

options=Options()
options.add_argument('--headless')
# profile = FirefoxProfile(r"./UserFirefox1/UserFirefox1")
# options.profile = profile
# profile.set_preference("useAutomationExtension", False)
# profile.set_preference("dom.webdriver.enabled", False)
# profile.update_preferences()

driver = Firefox(options=options)



FileNotFoundError: Could not find libxul.so
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
File <command-2609145928179932>:19
     12 options.add_argument('--headless')
     13 # profile = FirefoxProfile(r"./UserFirefox1/UserFirefox1")
     14 # options.profile = profile
     15 # profile.set_preference("useAutomationExtension", False)
     16 # profile.set_preference("dom.webdriver.enabled", False)
     17 # profile.update_preferences()
---> 19 driver = Firefox(options=options)

File /local_disk0/.ephemeral_nfs/envs/pythonEnv-18fb5352-7b20-4862-a378-025fa2a953cc/lib/python3.9/site-packages/undetected_geckodriver/driver.py:35, in Firefox.__init__(self, options, service, keep_alive)
     32 self._firefox_path: str = self._get_firefox_installation_path()
     33 self._undetected_path: str = self._get_undetected_firefox_path()
---> 35 self._setup_firefox_environment()
     37 self.service: Service = service or Service()
     38 self.options: Options = options or Options()

File /local_disk0/.ephemeral_nfs/envs/pythonEnv-18fb5352-7b20-4862-a378-025fa2a953cc/lib/python3.9/site-packages/undetected_geckodriver/driver.py:47, in Firefox._setup_firefox_environment(self)
     45 """Set up the undetected Firefox environment."""
     46 self._create_undetected_firefox_directory()
---> 47 self._patch_libxul_file()

File /local_disk0/.ephemeral_nfs/envs/pythonEnv-18fb5352-7b20-4862-a378-025fa2a953cc/lib/python3.9/site-packages/undetected_geckodriver/driver.py:100, in Firefox._patch_libxul_file(self)
     98 libxul_path: str = os.path.join(self._undetected_path, xul)
     99 if not os.path.exists(libxul_path):
--> 100     raise FileNotFoundError(f"Could not find {xul}")
    102 libxul_data = open(libxul_path, "rb").read()
    103 with open(libxul_path, "rb") as file:

FileNotFoundError: Could not find libxul.so