seleniumbase / SeleniumBase

📊 Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
4.46k stars 910 forks source link

Browser asks for SSL authentication in Selenium Grid. #2677

Closed kreethandsouza closed 2 months ago

kreethandsouza commented 2 months ago

I have a setup of selenium Grid using Docker and it is running a chrome. when i exec the script as a package from another container the driver spwns up but gives as for SSL authentication Screenshot from 2024-04-09 15-28-40 could anyone help me with this?

WaterLoran commented 2 months ago

First, confirm a few questions,

  1. Did you build this selenium grid? It is highly likely that it was not built by you
  2. When this seleniumgrid starts working, is it configured to require an account password to be entered when connecting (If you are using a third-party selenium grid or buying someone else's, usually you need to enter your account password)
mdmintz commented 2 months ago

See the Selenium Grid ReadMe SeleniumBase/seleniumbase/utilities/selenium_grid/ReadMe.md for using SeleniumBase with a Selenium Grid, and then see SeleniumBase/examples/capabilities for examples of configuring it.

kreethandsouza commented 2 months ago

First, confirm a few questions,

  1. Did you build this selenium grid? It is highly likely that it was not built by you
  2. When this seleniumgrid starts working, is it configured to require an account password to be entered when connecting (If you are using a third-party selenium grid or buying someone else's, usually you need to enter your account password)
  1. yes not built by me.
  2. No it doesnt ask for it here is the compose file version: '3.3'

services: service-selenium-hub: image: selenium/hub:4.10.0 container_name: service-selenium-hub ports:

when i spawn the browser from another container say

FROM python:3.9-alpine3.15

WORKDIR /seleniumbase

COPY / /seleniumbase

COPY requirements.txt /requirements.txt RUN apk update && \ apk add --no-cache gcc python3-dev musl-dev linux-headers chromium chromium-chromedriver && \ pip install -r requirements.txt && \ apk del gcc musl-dev linux-headers && \ rm -rf /var/cache/apk/ /root/.cache/

from this image where requirements has "seleniumbase" it will show "authencate proxy"

This would be my code to spawn it from another container

`from seleniumbase import Driver

agent = "Mozilla/5.0 (Linux; Android 13; CPH2487) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36" proxy = 'user:password@ip:port"' driver = Driver(uc=True, log_cdp=True, headless=False, no_sandbox=True, agent=agent, proxy=proxy, protocol='http', servername="service-selenium-hub", port="4444")

url = "https://www.google.com" driver.get(url)`

@mdmintz @WaterLoran Do help me out with this