Gosh, this repo is really a mess #1234
Replies: 5 comments 5 replies
-
@ultrafunkamsterdam Here's my suggestions:
|
Beta Was this translation helpful? Give feedback.
-
Yep found it what caused connection leak :) def __del__(self):
if self._custom_exe_path:
return
else:
timeout = 3
t = time.monotonic()
now = lambda: time.monotonic()
while now() - t > timeout:
try:
if self.user_multi_procs:
break
os.unlink(self.executable_path)
logger.debug("successfully unlinked %s" % self.executable_path)
break
except (OSError, RuntimeError, PermissionError) as error:
logging.error(error)
time.sleep(0.01)
continue
except FileNotFoundError as error:
logging.error(error)
break |
Beta Was this translation helpful? Give feedback.
-
You should make undetected chromedriver for playwright |
Beta Was this translation helpful? Give feedback.
-
yes plz ^ @ManiMozaffar |
Beta Was this translation helpful? Give feedback.
-
I'm not gonna create fork from this lib and maintain it myself, for 5 reasons:
https://github.com/ultrafunkamsterdam/undetected-chromedriver/blob/master/undetected_chromedriver/reactor.py Some reasons you should avoid code base:
And I'm not even sure if it's thread safe. Indeed it has sync api, but i think tbh its sync api is shit and you should be using the async api because most of actions here are "async" like intercepting a request, modifying request and etc. |
Beta Was this translation helpful? Give feedback.
-
Ok things that should've been fixed in this repo:
Using del, this repo has connection leak since when you started using del without knowing what is deferred finalization and how messing up with del can actually result in connection leak, memory leak or port exhaustion. You don't have to close chrome when script stop, nobody asked for this feature. people can literally call a method and quit or close the driver base on their needs.
Poorly implementation of downloading chromedriver
No github action and workflow to respect best CI practices. Perhaps you can run test to see if docker version of repo, or headless or headfull is detectable. You can even put trigger on chrome releases, and when a chrome is released then you can run this repo with latest chrome to see if it affect or not. if it does, creates an issue that chrome is detectable on that version
Why selenium? for serious, you could have used playwright, better support, better community, modern syntax, less overhead, more options.
Not adopted to latest selenium version, I've seen you've written some codes that was added as feature in selenium in later versions.
You hate contributors, I've mentioned many times that if you do not have free time then that's what open source is for. but you don't comment on PRs, you don't even check them after months, you just work on your local machine with your own code. Use others, for the repo's sake, and your sake.
Beta Was this translation helpful? Give feedback.
All reactions