gaspa93 / googlemaps-scraper

Google Maps reviews scraping
GNU General Public License v3.0
358 stars 131 forks source link

Support Initial place map url #10

Open SulimanLab opened 3 years ago

SulimanLab commented 3 years ago

Hello, is there a plan for supporting Initial place map url rather than clicking on reviews button.

the idea is i want to automate the whole extraction operation without human intervention (clicking on reviews).

gaspa93 commented 3 years ago

Hi @SulimanLab,

yes it is feasible: basically if you start from initial place map, you have to implement one more click. In doing so, you have also to take into account some exceptions, such as no review available, so for now I am not planning to do it because I can add it in the next steps. Thank you for your feedback, and if you want to proactively collaborate to develop this part, I appreciate a lot.

stajdini commented 1 year ago

In googlempas.py, under get_acount, I changed:

    self.driver.get(url)

to:

    self.driver.get(url)
    time.sleep(2)

    self.driver.find_elements_by_xpath('//*[@id="QA0Szd"]/div/div/div[1]/div[2]/div/div[1]/div/div/div[2]/div[1]/div[1]/div[2]/div/div[1]/div[2]').click()

and now I can use initial place map urls.