Actowiz Metrics Real-time
logo
analytics dashboard for brands! Try Free Demo
How-to-Scrape-Google-Events-Results-Data-with-Nodejs.jpg

What data will be extracted?

What-data-will-be-extracted.jpg

Complete Code

In case, you don’t want any explanation, just look at a complete code example given in online IDE

Complete-Code.jpg Complete-Code-2.jpg Complete-Code-3.jpg

Research

First, we have to make a Node.js* project as well as add npm packages to parse parts of a HTML markup, as well as axios to make the request for a website.

To make this in a directory with project, open a command line to enter:

Research.jpg

And after that:

And-after-that.jpg

*In case, you don’t get Node.js installed, it’s easy to download from nodejs.org as well as follow an installation documentation.

Procedure

Initially, we have to scrape data from an HTML elements. The procedure of having the correct CSS selectors is very easy through SelectorGadget Chrome extension that help us take CSS selectors by clicking on a desired element in a browser. Though, it doesn’t always work perfectly, particularly when a website is weightily utilized by JavaScript.

The Gif given here shows an approach of choosing various parts of results.

Procedure.jpg

Code Clarification

State constants from axios and cheerio libraries:

Code-Clarification.jpg

After that, we write about what we need to search with request options: HTTP headers having User-Agent that is used for acting as the "real" user visiting, and the required parameters to make a request:

Code-Clarification-2.jpg Code-Clarification-3.jpg

Note: Default axios request’s user-agent is axios/ therefore websites know that it's the script which sends the request and may block it. Observe what's the user-agent.

After that, we write the function, which makes a request as well as returns the required data from a page. We established the reply from axios request, which has a data key, which we de-structure and parse that using cheerio:

After-that,-we-write-the-function.jpg

After that, we check in case no “events” results on a page, we revert null. We do it to stop the scraper while there are no pages left:

After-that,-we-check-in-case-no-events.jpg

After that, we have to find images data from a script tags, as when a page loads for thumbnails as well as images utilize placeholders having resolution 1px x 1px with the real images and thumbnails are set with JavaScript in a browser.

Primary, we outline imagesPattern, then use spread syntax to create an array from the iterable iterators of matches, established from matchAll technique.

After that, we take results and create objects with the image url and id. To offer a valid url we have to remove "\x" chars (with replaceAll technique), decode that (with decodeURIComponent technique) and make from the objects images aray:

After-that,-we-take-results-and-create.jpg

After that, we have to get various parts of a page with next methods:

After-that,-we-have-to-get-various-parts-of-a-page-with-next-methods.jpg After-that,-we-have-to-get-various-parts-of-a-page-with-next-methods-2.jpg

After that, we write the function where we find results from every page (with while loop), check in case results are available, add them in the events array (push technique) and set request params newer start value (meaning that number from where we wish to see different results on next page).

While no more results on a page (else statement) we stop a loop and return events array:

While-no-more-results-on-a-page.jpg While-no-more-results-on-a-page-2.jpg

Now we could launch a parser:

Now-we-could-launch-a-parser.jpg

Output

Output.jpg Use Google Event API from Actowiz Solutions

This section shows a comparison between a DIY solution and Actowiz solution.

The largest difference is, you don’t have to make a parser from the scratch and preserve it.

There’s also an opportunity that a request could be blocked from Google, we deal with that on backend therefore, there’s no requirement to find out how to make that yourself or find out which proxy provider or CAPTCHA to use.

Initially, we have to install google-search-results-nodejs:

Use-Google-Event-API-from-Actowiz-Solutions.jpg

Here’s the complete code example, in case, you don’t want any explanation:

Here-s-the-complete-code-example.jpg Here-s-the-complete-code-example-2.jpg

Code Explanation

Primary, we have to declare Actowiz Solutions from google-search-results-nodejs library as well as get new search example with the API key from Actowiz Solutions:

Code-Explanation.jpg

After that, we write what is needed to search ( a searchQuery constant) and essential parameters to make a request:

After-that,-we-write-what-is-needed.jpg After-that,-we-write-what-is-needed-2.jpg

After that, we wrap a search method from Actowiz Solutions library in the promise to work further with search results:

After-that,-we-wrap-a-search.jpg

And lastly, we declare a function getResult which gets data from every page as well as return it:

And-lastly,-we-declare-a-function.jpg

With this function, we find json with different results from every page (with while loop), observe if events_results are available, add them with eventsResults array (push technique) and set request new start value (meaning a number from where we wish to get results on next page).

While no more results on a page (else statement), stop a loop as well as return an eventsResults array:

With-this-function,-we-find.jpg

After that, we run a getResults function as well as print all the collected information in a console with console.dir technique that helps you to utilize an object using the required parameters to alter default output alternatives:

After-that,-we-run-a.jpg

Output

Output-2.jpg

And that’s it, the desired data is scraped!

For more information, contact Actowiz Solutions now!

You can also contact us for your mobile app scraping and web scraping services requirements.

Social Proof That Converts

Trusted by Global Leaders Across Q-Commerce, Travel, Retail, and FoodTech

Our web scraping expertise is relied on by 4,000+ global enterprises including Zomato, Tata Consumer, Subway, and Expedia — helping them turn web data into growth.

4,000+ Enterprises Worldwide
50+ Countries Served
20+ Industries
Join 4,000+ companies growing with Actowiz →
Real Results from Real Clients

Hear It Directly from Our Clients

Watch how businesses like yours are using Actowiz data to drive growth.

1 min
★★★★★
"Actowiz Solutions offered exceptional support with transparency and guidance throughout. Anna and Saga made the process easy for a non-technical user like me. Great service, fair pricing!"
TG
Thomas Galido
Co-Founder / Head of Product at Upright Data Inc.
2 min
★★★★★
"Actowiz delivered impeccable results for our company. Their team ensured data accuracy and on-time delivery. The competitive intelligence completely transformed our pricing strategy."
II
Iulen Ibanez
CEO / Datacy.es
1:30
★★★★★
"What impressed me most was the speed — we went from requirement to production data in under 48 hours. The API integration was seamless and the support team is always responsive."
FC
Febbin Chacko
-Fin, Small Business Owner
icons 4.8/5 Average Rating
icons 50+ Video Testimonials
icons 92% Client Retention
icons 50+ Countries Served

Join 4,000+ Companies Growing with Actowiz

From Zomato to Expedia — see why global leaders trust us with their data.

Why Global Leaders Trust Actowiz

Backed by automation, data volume, and enterprise-grade scale — we help businesses from startups to Fortune 500s extract competitive insights across the USA, UK, UAE, and beyond.

icons
7+
Years of Experience
Proven track record delivering enterprise-grade web scraping and data intelligence solutions.
icons
4,000+
Projects Delivered
Serving startups to Fortune 500 companies across 50+ countries worldwide.
icons
200+
In-House Experts
Dedicated engineers across scrapers, AI/ML models, APIs, and data quality assurance.
icons
9.2M
Automated Workflows
Running weekly across eCommerce, Quick Commerce, Travel, Real Estate, and Food industries.
icons
270+ TB
Data Transferred
Real-time and batch data scraping at massive scale, across industries globally.
icons
380M+
Pages Crawled Weekly
Scaled infrastructure for comprehensive global data coverage with 99% accuracy.

AI Solutions Engineered
for Your Needs

LLM-Powered Attribute Extraction: High-precision product matching using large language models for accurate data classification.
Advanced Computer Vision: Fine-grained object detection for precise product classification using text and image embeddings.
GPT-Based Analytics Layer: Natural language query-based reporting and visualization for business intelligence.
Human-in-the-Loop AI: Continuous feedback loop to improve AI model accuracy over time.
icons Product Matching icons Attribute Tagging icons Content Optimization icons Sentiment Analysis icons Prompt-Based Reporting

Connect the Dots Across
Your Retail Ecosystem

We partner with agencies, system integrators, and technology platforms to deliver end-to-end solutions across the retail and digital shelf ecosystem.

icons
Analytics Services
icons
Ad Tech
icons
Price Optimization
icons
Business Consulting
icons
System Integration
icons
Market Research
Become a Partner →

Popular Datasets — Ready to Download

Browse All Datasets →
icons
Amazon
eCommerce
Free 100 rows
icons
Zillow
Real Estate
Free 100 rows
icons
DoorDash
Food Delivery
Free 100 rows
icons
Walmart
Retail
Free 100 rows
icons
Booking.com
Travel
Free 100 rows
icons
Indeed
Jobs
Free 100 rows

Latest Insights & Resources

View All Resources →
thumb
Blog

RERA Data Aggregation All-State Real Estate Compliance Tracking in India

Aggregate RERA data across all 28 Indian states + UTs. Real-time project, builder, and compliance intelligence for India ?40+ trillion real estate market.

thumb
Case Study

How a Q-Commerce Startup Saved ₹2.8 Cr/Year by Tracking Blinkit, Zepto & Instamart in Real-Time

Discover how a Q-commerce startup saved ₹2.8 Cr annually by tracking Blinkit, Zepto, and Instamart in real time. Learn how data-driven pricing and inventory insights boost efficiency and profitability.

thumb
Report

Scrape In-N-Out Burger locations data in the USA in 2026 – Expansion Trends, Market Coverage & Insights

Scrape In-N-Out Burger locations data in the USA in 2026 to analyze store expansion, regional coverage, and market trends.

Start Where It Makes Sense for You

Whether you're a startup or a Fortune 500 — we have the right plan for your data needs.

icons
Enterprise
Book a Strategy Call
Custom solutions, dedicated support, volume pricing for large-scale needs.
icons
Growing Brand
Get Free Sample Data
Try before you buy — 500 rows of real data, delivered in 2 hours. No strings.
icons
Just Exploring
View Plans & Pricing
Transparent plans from $500/mo. Find the right fit for your budget and scale.
Get in Touch
Let's Talk About
Your Data Needs
Tell us what data you need — we'll scope it for free and share a sample within hours.
  • icons
    Free Sample in 2 HoursShare your requirement, get 500 rows of real data — no commitment.
  • icons
    Plans from $500/monthFlexible pricing for startups, growing brands, and enterprises.
  • icons
    US-Based SupportOffices in New York & California. Aligned with your timezone.
  • icons
    ISO 9001 & 27001 CertifiedEnterprise-grade security and quality standards.
Request Free Sample Data
Fill the form below — our team will reach out within 2 hours.
+1
Free 500-row sample · No credit card · Response within 2 hours

Request Free Sample Data

Our team will reach out within 2 hours with 500 rows of real data — no credit card required.

+1
Free 500-row sample · No credit card · Response within 2 hours