You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a SB based scraper that perfectly works locally on MacOS - it opens the listing page, clicks protected element and reads text.
url = "https://www.otomoto.pl/osobowe/oferta/ford-mondeo-ford-mondeo-mk4-ID6H0DTK.html"
with SB(uc=True, headless=True, xvfb=True) as sb:
print("SB created")
sb.driver.uc_open_with_reconnect(url, reconnect_time=6)
However, it doesn't work when I am trying to run the code in docker. The SB object is created but it is not able to open the page. After a couple of minutes processing the error is:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py", line 496, in uc_open_with_reconnect
driver, driver.window_handles[-1], 2
File "/usr/local/lib/python3.10/dist-packages/seleniumbase/undetected/__init__.py", line 328, in __getattribute__
return super().__getattribute__(item)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 612, in window_handles
return self.execute(Command.W3C_GET_WINDOW_HANDLES)["value"]
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id
I have tried different combinations of options headless, xvfb, incognito and none of them worked.
I've also tried the cdp mode which also didn't work.
I build my Docker image with --platform linux/amd64.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a SB based scraper that perfectly works locally on MacOS - it opens the listing page, clicks protected element and reads text.
However, it doesn't work when I am trying to run the code in docker. The SB object is created but it is not able to open the page. After a couple of minutes processing the error is:
I have tried different combinations of options headless, xvfb, incognito and none of them worked.
I've also tried the cdp mode which also didn't work.
I build my Docker image with --platform linux/amd64.
The same Docker container can open other websites:
https://gitlab.com/users/sign_in
and even https://www.otomoto.pl - the home page of the website I am trying to open.
Beta Was this translation helpful? Give feedback.
All reactions