Google Maps Scraper avatar

Google Maps Scraper

Try for free

No credit card required

Go to Store
Google Maps Scraper

Google Maps Scraper

compass/crawler-google-places
Try for free

No credit card required

Extract data from hundreds of Google Maps locations and businesses. Get Google Maps data including reviews, images, contact info, opening hours, location, popular times, prices & more. Export scraped data, run the scraper via API, schedule and monitor runs, or integrate with other tools.

Do you want to learn more about this Actor?

Get a demo
LE

A second instance of the actor is being ran

Closed

leadagency opened this issue
3 months ago

Please look into this because when I run a google maps some way through it does this (see below) and then runs a SECOND version of the Actor and begins crawling so 2 are running at the same time.

What is going on and can you fix this? Have a look at my other runs.

Here it is "migrating to a new host" and restarting then when this happens a second crawl is being initiated.

2024-09-25T09:26:38.066Z ACTOR: Run was migrated to a new host. 2024-09-25T09:26:38.083Z ACTOR: Pulling Docker image of build YYPbUDV5FDRPkgBDs from repository. 2024-09-25T09:27:01.460Z ACTOR: Creating Docker container. 2024-09-25T09:27:10.838Z ACTOR: Starting Docker container. 2024-09-25T09:27:15.127Z Starting X virtual framebuffer using: Xvfb :99 -ac -screen 0 1920x1080x24+32 -nolisten tcp 2024-09-25T09:27:15.129Z Executing main command 2024-09-25T09:27:17.039Z INFO System info {"apifyVersion":"3.1.14","apifyClientVersion":"2.8.4","crawleeVersion":"3.11.3","osType":"Linux","nodeVersion":"v18.20.3"} 2024-09-25T09:27:17.250Z INFO Based on provided memory of 4 GB, we set maximum concurrency to 4 and starting concurrency to 1. This helps to reduce timeouts and overscaling. 2024-09-25T09:27:17.770Z WARN Actor was restarted, skipping geolocation and start URL preparation and loading them from Key-Value Store 2024-09-25T09:27:37.105Z INFO CheerioCrawler: Starting the crawler.

milunnn avatar

Hi,

Sorry for the late response. We will check the runs and let you know of any updates.

milunnn avatar

Hey,

It seems like you are running your own custom Actor, but you have not implemented state management, so after your custom Actor goes through a migration, its state gets reset and it runs the Google Maps Scraper again. Solution for that is to implement state management in your Actor to save the current Google Maps run ID when migrating, which could be loaded after the migration is done.

If you have any more questions, please do not hesitate to ask.

LO

leadagency-owner

2 months ago

Hi Milan,

My developer is asking how he can we implement state management in our actor?

ondrejklinovsky avatar

Hey,

I apologize for late response, we were having some issues with notifications.

There are two things that you need to do:

  1. after you start Google Maps Scraper, you should immediately store the run's ID in key value store.
  2. before you start Google Maps Scraper, you should check if there's a run ID stored in key value store
  • if it is stored, use that run
  • if it isn't stored, start a new run (1. point)

Milan shared a link to a state persistance tutorial, you should find some examples there.

I'm gonna close the issue, but feel free to reopen if you have more questions.

Developer
Maintained by Apify

Actor Metrics

  • 3.4k monthly users

  • 607 stars

  • 98% runs succeeded

  • 5.8 days response time

  • Created in Nov 2018

  • Modified 3 hours ago