Attempting to Implement HTTP Basic Authentication with API Keys (Python)

7 views
Skip to first unread message

Flip Flop

unread,
Aug 19, 2025, 11:33:54 PMAug 19
to Selenium Users
Hi,

I am trying to access a site that requires me to use basic authentication. However, I use SSO to, login into the site. 

I generated an API key and secret pair from the site itself I can use as the username/password values to authenticate. These API keys work great when using Python's requests library, I add them in the header of the request.

However, I am struggling with Selenium. I need to scrape the HTML page, which loads with JavaScript, so I can't use Python's requests library to fetch the element I want. 
I've tried:
1) Authenticating with the requests library first to fetch cookies and trying to pass them after with Selenium

I am a bit lost on what to try next. I appreciate any help.

Additional Info:
Python 3.13.5
Selenium 4.24.0
Visual Studio Code


Reply all
Reply to author
Forward
0 new messages