Selenium and headless Firefox on Prefect

Trying to get a script that uses Selenium with headless Firefox working. I have it working on the local/dev cluster, but on “production” selenium, I am seeing:

Encountered exception during execution:
Traceback (most recent call last):
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/prefect/engine.py", line 665, in orchestrate_flow_run
    result = await run_sync(flow_call)
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 154, in run_sync_in_interruptible_worker_thread
    async with anyio.create_task_group() as tg:
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 662, in __aexit__
    raise exceptions[0]
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 135, in capture_worker_thread_and_result
    result = __fn(*args, **kwargs)
  File "/tmp/tmplduj88wmprefect/emerge_orbis_get_bids.py", line 21, in prod_emerge_orbis
    EmergeOrbisBids().getBids(logger)
  File "/tmp/tmplduj88wmprefect/emerge_orbis_get_bids.py", line 88, in getBids
    self.driver.close()
AttributeError: 'EmergeOrbisBids' object has no attribute 'driver'
04:19:13 PM
prefect.flow_runs
Finished in state Failed("Flow run encountered an exception. AttributeError: 'EmergeOrbisBids' object has no attribute 'driver'\n")

I am pretty much trying

        logger.info("Running get bids from EMERGE : ORBIS...")
        try:
            logger.info("Getting driver...")
            options = Options()
            options.add_argument("-headless")
            self.driver = webdriver.Firefox(options)

Not sure if anyone has tried this, but any help would be appreciated!

Thanks

Joe

An update here:
I switched to Chrome instead, and modified the Prefect Docker build to use Chrome:

# Install Google Chrome
RUN apt-get update && apt-get install -y wget unzip && \
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
apt install -y ./google-chrome-stable_current_amd64.deb && \
rm google-chrome-stable_current_amd64.deb && \
apt-get clean

Seems to work well.