omkarcloud / google-maps-scraper

👋 HOLA 👋 HOLA 👋 HOLA ! ENJOY OUR GOOGLE MAPS SCRAPER 🚀 TO EFFORTLESSLY EXTRACT DATA SUCH AS NAMES, ADDRESSES, PHONE NUMBERS, REVIEWS, WEBSITES, AND RATINGS FROM GOOGLE MAPS WITH EASE! 🤖
https://www.omkar.cloud/
MIT License
863 stars 211 forks source link

program not working on wsl2 #125

Closed salmansarwar5102 closed 3 months ago

salmansarwar5102 commented 4 months ago

Full error here:

https://paste.ofcode.org/na4EBhXZxUiNpS5sJtuZdJ

Chetan11-dev commented 4 months ago

Kindly Run python -m pip install botasaurus --upgrade

salmansarwar5102 commented 4 months ago

After running the above command this error shows:

Chrome failed to launch. Retrying with additional server options. To add server options by default, include '--server' in your launch command.

Full error in this link: https://paste.ofcode.org/37qagkEBreN6QqR7iAr5a4q

Chetan11-dev commented 4 months ago

Does "python main.py --server" works? Also, in which system are you running it?

Nneji123 commented 4 months ago

I'm also facing this issue. Using the gitpod space it works but trying to use it with GitHub codespaces I get an error(chrome crashes). Also with docker it crashes. But it works on windows.

salmansarwar5102 commented 4 months ago

Does "python main.py --server" works? Also, in which system are you running it?

no it doesn't work. I am running Windows Subsystem for Linux WSL2

Chetan11-dev commented 4 months ago

I believe that to get the Google Maps scraper working, we need to add a set of options to Chrome. Could you please open src/scraper.py and modify the add_arguments function as shown below? After making these changes, please try running the scraper again.

Original add_arguments function:

def add_arguments(data, options):
    options.add_experimental_option(
        "prefs", {
            "profile.managed_default_content_settings.images": 2,
            # "profile.managed_default_content_settings.stylesheet": 2,
            # "profile.managed_default_content_settings.fonts": 2,
        }
    )

Updated add_arguments function with additional arguments:

def add_arguments(data, options):
    options.add_experimental_option(
        "prefs", {
            "profile.managed_default_content_settings.images": 2,
            # "profile.managed_default_content_settings.stylesheet": 2,
            # "profile.managed_default_content_settings.fonts": 2,
        }
    )

    options.add_argument("--no-sandbox")
    options.add_argument("--disable-dev-shm-usage")
    options.add_argument("--headless")
    options.add_argument("--disable-gpu")
    options.add_argument("--disable-extensions")
    options.add_argument("--disable-infobars")