Closed ganyu87 closed 2 months ago
This is due to chrome having crashed (or not even started)
use webdriver.Chrome(debug=True)
for viewing the logs.
likely, you're running as root or headless and --no-sandbox
or --headless=new
solves this issue
@kaliiiiiiiiii
Omg, i dont know about this. I should be read more from documentation
script:
from selenium_driverless import webdriver
from selenium_driverless.types.by import By
import asyncio
async def main():
options = webdriver.ChromeOptions()
options.add_argument("--headless=new")
options.add_argument("--no-sandbox")
async with webdriver.Chrome(options=options,debug=True) as driver:
await driver.get('http://nowsecure.nl#relax', wait_load=True)
await driver.sleep(0.5)
print(await driver.title)
asyncio.run(main())
result:
python3.12 test.py
/usr/local/lib/python3.12/site-packages/selenium_driverless/webdriver.py:161: UserWarning: headless is detectable at first run
warnings.warn("headless is detectable at first run")
[3443585:3443610:0423/050327.208160:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[3443585:3443610:0423/050327.208323:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[3443585:3443610:0423/050327.208369:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[3443585:3443610:0423/050327.208404:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[3443585:3443610:0423/050327.233922:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[3443585:3443610:0423/050327.233976:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
DevTools listening on ws://127.0.0.1:39023/devtools/browser/9e3ebaaf-439d-44a5-b79a-8b009633b8de
[3443585:3443610:0423/050327.395341:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[3443585:3443585:0423/050327.412851:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[3443585:3443692:0423/050327.425667:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower wasnot provided by any .service files
[3443585:3443692:0423/050327.426010:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPowerwas not provided by any .service files
[3443585:3443692:0423/050327.426275:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPowerwas not provided by any .service files
nowsecure.nl
WORK. THANKS!!!
Hi, i got error "timeout" when try simple script in my VPS May you help me what's wrong with this?
here is the detail OS:
Environment:
Script:
Result:
Thank you