I have move from Selenium/SeleniumBase to DrissionPage for it's Undetectable Ability. Everything was easy to understand. Except the last part of it. That is Closing the Browser. The Docs says that page.quit()
would close the browser. But When I run it in my local machine I get this error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\threading.py", line 973, in _bootstrap_inner
self.run()
File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\site-packages\DrissionPage\chromium_driver.py", line 123, in _recv_loop
message = loads(message_json)
File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Here's The least of code:
from DrissionPage import ChromiumPage
from time import sleep
page = ChromiumPage()
page.get('https://www.google.com/')
sleep(5)
page.quit()
My specs are:
{
"OS": "Windows 10 64 Bit",
"OS_Version": "10.0 Build (10240)",
"Browser": "Google Chrome",
"Browser Version": "120.0.6099.130 (Official Build) (64-bit)"
}
How to fix this error and close it? Or, is there any alternative way to close it?
I am the author of DrissionPage, thank you for liking my work. Version 4.0 is fine. Now in beta, the latest is 4.0.0b26.
pip install DrissionPage==4.0.0b26