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/", line 665, in orchestrate_flow_run
    result = await run_sync(flow_call)
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/prefect/utilities/", 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/", line 662, in __aexit__
    raise exceptions[0]
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/anyio/", 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/", line 937, in run_sync_in_worker_thread
    return await future
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/anyio/_backends/", line 867, in run
    result =, *args)
  File "/opt/conda/envs/prefect/lib/python3.10/site-packages/prefect/utilities/", line 135, in capture_worker_thread_and_result
    result = __fn(*args, **kwargs)
  File "/tmp/tmplduj88wmprefect/", line 21, in prod_emerge_orbis
  File "/tmp/tmplduj88wmprefect/", line 88, in getBids
AttributeError: 'EmergeOrbisBids' object has no attribute 'driver'
04:19:13 PM
Finished in state Failed("Flow run encountered an exception. AttributeError: 'EmergeOrbisBids' object has no attribute 'driver'\n")

I am pretty much trying"Running get bids from EMERGE : ORBIS...")
  "Getting driver...")
            options = Options()
            self.driver = webdriver.Firefox(options)

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



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 && \
apt install -y ./google-chrome-stable_current_amd64.deb && \
rm google-chrome-stable_current_amd64.deb && \
apt-get clean

Seems to work well.