omkarcloud / botasaurus

The All in One Framework to build Awesome Scrapers.
https://www.omkar.cloud/botasaurus/
MIT License
1.16k stars 104 forks source link

Chrome failed to start error on ubuntu 22.04 server, p3.10 #47

Closed vmehera123 closed 5 months ago

vmehera123 commented 5 months ago

Locally works fine, I want to move the scrapper to my server, and faced an error:

Code:

from botasaurus import *

@browser(
    reuse_driver=True,
    keep_drivers_alive=True,
    headless=True,
    block_resources=[
        ".css",
        ".jpg",
        ".jpeg",
        ".png",
        ".svg",
        ".gif",
        ".woff",
        ".pdf",
        ".zip",
    ],

)
def get_url_text(driver: AntiDetectDriver, url: str) -> str:
    driver.get(url)
    soup = driver.bs4()

get_url_text("https://github.com/Nv7-GitHub/googlesearch")

Failed with error:

`Running Message: session not created: Chrome failed to start: exited normally. (session not created: DevToolsActivePort file doesn't exist) (The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Stacktrace:

0 0x55bdcb62bd93

1 0x55bdcb30f337

2 0x55bdcb343bc0

3 0x55bdcb33f765

4 0x55bdcb389b7c

5 0x55bdcb37d1e3

6 0x55bdcb34d135

7 0x55bdcb34e13e

8 0x55bdcb5efe4b

9 0x55bdcb5f3dfa

10 0x55bdcb5dc6d5

11 0x55bdcb5f4a6f

12 0x55bdcb5c069f

13 0x55bdcb619098

14 0x55bdcb619262

15 0x55bdcb62af34

16 0x7fc31a837ac3 `

Seems like something wrong with chromedriver. The current version is:

chromedriver-121 --version 
ChromeDriver 121.0.6167.85 (3f98d690ad7e59242ef110144c757b2ac4eef1a2-refs/branch-heads/6167@{#1539})
Chetan11-dev commented 5 months ago

Try https://github.com/omkarcloud/botasaurus/issues/41

vmehera123 commented 5 months ago

@Chetan11-dev Man, big thanks! I suggest to add this into README, really save a lot of time!