Skip to content

Support Linux drivers for aarch64 / arm64 #4546

Closed

Description

@pacjo

Hi, I wanted to run seleniumbase on a linux arm64 vm and run into some issues:

  • dockerfile is hardcoded to download amd64 chrome binary. This is easy to fix with the following change:
diff --git a/Dockerfile b/Dockerfile
index 08c878c4..8e5ef426 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -84,10 +84,11 @@ RUN apt-get -qy --no-install-recommends install \
 #================
 # Install Chrome
 #================
+ARG BUILDARCH
 RUN apt-get update
-RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
-RUN apt-get install -y ./google-chrome-stable_current_amd64.deb
-RUN rm ./google-chrome-stable_current_amd64.deb
+RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_$BUILDARCH.deb -O ./google-chrome.deb
+RUN apt-get install -y ./google-chrome.deb
+RUN rm ./google-chrome.deb

 #================
 # Install Python
  • seleniumbase/console_scripts/sb_install.py has very partial support for linux aarch64. That means:
    • flag IS_ARM_LINUX exists and is properly set on my setup, but isn't actually used anywhere
    • some places don't check for aarch64 under linux at all:
          elif IS_LINUX:
              file_name = "edgedriver_linux64.zip"
              suffix = "LINUX"
          else:
    • and some check, but don't use IS_ARM_LINUX var:
          elif IS_LINUX:
              if "64" in ARCH:
                  if "aarch64" in platform.processor():
                      file_name = (
                          "geckodriver-%s-linux-aarch64.tar.gz" % use_version
                      )
                  else:
                      file_name = "geckodriver-%s-linux64.tar.gz" % use_version
              else:
                  file_name = "geckodriver-%s-linux32.tar.gz" % use_version

also this script is 1500+ lines and has a lot of duplication, which makes fixing it a mess.

Activity

  1. pacjo commented on Nov 4, 2026

    @pacjo
    Author

    Please consider implementing the suggested changes, since the library alone seems to work correctly, and problems are only related to obtaining chrome and webdrivers.

  2. changed the title [-]Doesn't work on linux aarch64 due to hardcoded amd64[/-] [+]Support Linux drivers for aarch64 / arm64[/+] on Nov 4, 2026
  3. self-assigned this
    on Nov 4, 2026
  4. mdmintz commented on Nov 4, 2026

    @mdmintz
    Member

    Thanks for reminding me.
    Google recently added the new drivers, which means I can now support them with SeleniumBase:

    Image

    Since Microsoft hasn't yet added that support for Linux ARM64, msedgedriver won't be included in the update:

    Image

    Also note that SeleniumBase's (Pure CDP Mode) already supports ARM64 Linux. Eg:
    https://github.com/mdmintz/undetected-testing/actions/runs/41013015157/job/123922919966

    I'll add the Linux ARM64 support for chromedriver. (Pure CDP Mode doesn't need external drivers)

  5. pacjo commented on Nov 4, 2026

    @pacjo
    Author

    Google recently added the new drivers, which means I can now support them with SeleniumBase

    Thank you.

    Also note that SeleniumBase's (Pure CDP Mode) already supports ARM64 Linux.

    I wasn't aware, though I think the error was caused by the force install of chrome in the Dockerfile so it's still impossible to use unmodified image on aarch64 linux even with the CDP support.

    I'm using sb_cdp.* methods in my script with image based on repo's Dockerfile and still run into issues. Is there a known problem with youtube videos? They run for a while and stop. The behavior is consistent inside container, but doesn't happen when running on the host itself.

  6. mdmintz commented on Nov 4, 2026

    @mdmintz
    Member

    Pure CDP Mode is the format that starts with: from seleniumbase import sb_cdp. Eg:

    from seleniumbase import sb_cdp
    
    sb = sb_cdp.Chrome(fast=True)
    sb.goto("https://seleniumbase.io/demo_page")
    sb.type("input", "Quickly type text!")
    sb.press_keys("textarea", "Slowly type text!")
    sb.click("#myButton")
    sb.set_value("input#mySlider", "100")
    sb.click_visible_elements("input.checkBoxClassB")
    sb.select_option_by_text("#mySelect", "Set to 75%")
    sb.hover_and_click("#myDropdown", "#dropOption2")
    sb.click("#checkBox1")
    sb.drag_and_drop("img#logo", "div#drop2")
    sb.nested_click("iframe#myFrame3", ".fBox")
    sb.highlight("#myButton")
    sb.quit()

    That format works in ARM64 Linux, eg:
    https://github.com/mdmintz/undetected-testing/actions/runs/41013015157/job/123922919966

    You would currently use the unbranded Chromium browser in there: sudo apt-get install -y chromium
    As seen in the YML file that was used for that: https://github.com/mdmintz/undetected-testing/blob/06fab19860a0a72846dea7d915a68b4f4e153e41/.github/workflows/python-package-7.yml

    If using Docker, you would need to do something similar.

    Since you mentioned that you are using sb_cdp, that's already set for ARM64 Linux for Pure CDP Mode.

    The changes that I'm making for this ticket are for the drivers (chromedriver), which is typically only used for regular selenium tests that don't require stealth.

  7. mdmintz commented on Nov 5, 2026

    @mdmintz
    Member
  8. pacjo commented on Nov 5, 2026

    @pacjo
    Author

    Hi, thanks for the quick fix, but it looks like Dockerfile issue is still unresolved. The latest in main still has amd64 arch hardcoded:

    RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

  9. mdmintz commented on Nov 5, 2026

    @mdmintz
    Member

    The Dockerfile is just a boilerplate for people to create their own Dockerfiles. It's not used internally in the framework itself.

  10. pacjo commented on Nov 5, 2026

    @pacjo
    Author

    Hm, that isn't clear for the project documentation. Could you consider adding this information to either the docs or the Dockerfile itself?

  11. mdmintz commented on Nov 5, 2026

    @mdmintz
    Member

    I updated the Dockerfile to include the new info: 635a8bc

  12. pacjo commented on Nov 5, 2026

    @pacjo
    Author

    thank you

  13. mdmintz commented on Nov 6, 2026

    @mdmintz
    Member

    If you find the SeleniumBase repo helpful, don't forget to give it a star ⭐!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions