Skip to content

Conversation

jh27539
Copy link
Collaborator

@jh27539 jh27539 commented Sep 12, 2025

Purpose

The Problem
Browsers normally have a user agent field that looks like this:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36

Originally, I was trying to append a "Selenium Bot" tag to the existing user agent field in order to preserve this information.

  1. Launch browser
  2. Collect default user agent
  3. Close browser
  4. Re-launch browser
  5. Append user agent field

This worked great locally, but re-launching browsers is not compatible with github actions workflows.

The Fix
Scrap the extra steps and just override the user agent tag to say OSF Selenium Bot. This is good enough for our devops folks to monitor our daily automated traffic.

Summary of Changes

  • Stop relaunching browsers to collect user agent fields & override them
  • Instead, just launch browser once with OSF Selenium Bot custom tag
  • Bonus: Upgrade OS version to Windows11

Reviewer's Actions

git fetch origin pull/289/head:gha/fix_browsers

Run this test locally with Firefox or Edge browser
tests/test_search.py -sv

Or Run a GHA workflow via browser.

Testing Changes Moving Forward

We still need to update for MSEdge when we update to SELv4

Ticket

https://openscience.atlassian.net/browse/ENG-8286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant