SERP - Google Search Results Crawler API avatar

SERP - Google Search Results Crawler API

Try for free

1 day trial then $20.00/month - No credit card required now

Go to Store
SERP - Google Search Results Crawler API

SERP - Google Search Results Crawler API

rajtripathi2580/jscrawler
Try for free

1 day trial then $20.00/month - No credit card required now

SERP - Google Search Results Crawler API 1. Fetch unlimited search results from Google. 2. Retrieve titles, snippets, and links for each result. 3. Get real-time data for accurate insights. 4. Customize queries by keywords, location, and language.

JavaScript Crawlee & CheerioCrawler template

This template example was built with Crawlee to scrape data from a website using Cheerio wrapped into CheerioCrawler.

Included features

  • Apify SDK - toolkit for building Actors
  • Crawlee - web scraping and browser automation library
  • Input schema - define and easily validate a schema for your Actor's input
  • Dataset - store structured data where each object stored has the same attributes
  • Cheerio - a fast, flexible & elegant library for parsing and manipulating HTML and XML

How it works

This code is a JavaScript script that uses Cheerio to scrape data from a website. It then stores the website titles in a dataset.

  • The crawler starts with URLs provided from the input startUrls field defined by the input schema. Number of scraped pages is limited by maxPagesPerCrawl field from the input schema.
  • The crawler uses requestHandler for each URL to extract the data from the page with the Cheerio library and to save the title and URL of each page to the dataset. It also logs out each result that is being saved.

Resources

Getting started

For complete information see this article. In short, you will:

  1. Build the Actor
  2. Run the Actor

Pull the Actor for local development

If you would like to develop locally, you can pull the existing Actor from Apify console using Apify CLI:

  1. Install apify-cli

    Using Homebrew

    brew install apify-cli

    Using NPM

    npm -g install apify-cli
  2. Pull the Actor by its unique <ActorId>, which is one of the following:

    • unique name of the Actor to pull (e.g. "apify/hello-world")
    • or ID of the Actor to pull (e.g. "E2jjCZBezvAZnX8Rb")

    You can find both by clicking on the Actor title at the top of the page, which will open a modal containing both Actor unique name and Actor ID.

    This command will copy the Actor into the current directory on your local machine.

    apify pull <ActorId>

Documentation reference

To learn more about Apify and Actors, take a look at the following resources:

Developer
Maintained by Community

Actor Metrics

  • 1 monthly user

  • 1 star

  • >99% runs succeeded

  • Created in Nov 2024

  • Modified 7 days ago