flathunters / flathunter

A bot to help people with their rental real-estate search. 🏠🤖

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with `undetected_chromedriver`

robertszooba opened this issue · comments

The problem I often face (besides #589) is undetected_chromedriver, more specifically:

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:61315
from chrome not reachable
Stacktrace:
0   undetected_chromedriver             0x0000000107755ae8 undetected_chromedriver + 5217000
[...]
19  libsystem_pthread.dylib             0x00007ff804eb0ae3 thread_start + 15

[2024/05/11 16:00:22|__init__.py             |INFO    ]: ensuring close

Interestingly, sometimes the program does start. It's as if the driver search is happening in a non-deterministic manner, which seems improbable.

Is it a known way to fix this problem?

I think this message means that the browser process has died. This can happen after a while - maybe there's a memory leak somewhere. You can try increase the memory available (if you're running inside docker, for example, with limited memory available). Alternatively, you can run flathunter in 'one-shot' mode - turn off loop, and just trigger periodic runs out of cron so that you're always getting a fresh process.