diegoparrilla / headless-chrome-aws-lambda-layer

Headless Chrome prepared to run as a layer in AWS lambda with Python >=3.8 and Amazon Linux 2
Apache License 2.0
70 stars 14 forks source link

Missing file #5

Open Lars-Albinsson opened 2 years ago

Lars-Albinsson commented 2 years ago

Uploaded and tried the layer and python test code. Got this error. Is the file DevToolsActivePort missing from this kit or is it supposed to come from somewhere else?


[ERROR] WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist)

Lars-Albinsson commented 2 years ago

I found a solution, thorugh stack overflow. This works (for me=

new_params = [
    "--window-size=800x600",
    "--user-agent=MyUserAgent",
    "start-maximized",
    "disable-infobars"
    "--disable-extensions",
    "--disable-gpu",
    "--disable-dev-shm-usage",
    "--no-sandbox"
]

driver = create_driver(new_params)
driver.get("https://www.google.com")
return driver.page_source

https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t/50642913#50642913