DEV Community

Natasha Lekh for Apify

Posted on • Originally published at blog.apify.com on

10 Google search tricks (that are also Google scraping tricks)

Can you apply Google search tricks to scraping and data extraction as well? Lets put it to the test!

We're Apify , the only full-stack web scraping platform. You can build, deploy, share, and monitor scrapers or APIs for any website on Apify.

The savvy Googlers among us always have a few tricks up their sleeve. The question is: can you apply these Google search tricks to scraping and data extraction as well? Lets put it to the test! But before we start, we need to address the elephant in the blog.

๐Ÿค” What do Google search shortcuts have to do with web scraping?

Millions of people rely on Google search every day. Be it for school, research, or simple entertainment, if you know a few Google search shortcuts, your search process is more efficient. The thing is, a lot of those Google search tricks can also apply to web scraping.

The reason for this is simple: what a Google scraper does is very similar to what a Google visitor does: it goes to the google.com website, types in a query (even if it contains a shortcut), and receives results. The only difference is that the scraper also copies the results at lightning speed and packages them into a file.

This means that, if you are familiar with Google tricks and shortcuts, you can use that knowledge to upgrade your Google scraping process. When we built our Google Search Scraper ๐Ÿ”— back in the day, we didn't count on this. Now that Google Scraper (also known as Google SERP API) has over 40,000 users, we feel obliged to everyone know about this interesting peculiarity.

https://blog.apify.com/unofficial-google-search-api-from-apify-22a20537a951/

Learn how to use our Google Search Scraper without tricks

๐Ÿ’ก 10 Google search tricks (that are also Google scraping tricks)

So let's put 10 well-known tricks to the test and level up your Google scraping. In other words, let's learn how to scrape Google like a pro ๐Ÿ˜Ž

Use site: to scrape specific sites

#1. Add site: after your keyword to narrow down the search to a specific website. For example, visualize site:blog.apify.com

#1. Add site: after your keyword to narrow down the search to a specific website. For example, visualize site:blog.apify.com

#1. Add site: after your keyword to narrow down the search to a specific website. For example, visualize site:blog.apify.com

This is probably the most well-known Google search shortcut to narrow down your search on a specific website without visiting it. The thing is, you can use this same trick not only to search but also to scrape content from that particular website. The syntax is very simple keyword + site:website.com. The screenshot above shows how you can apply it to our Google Scraper ๐Ÿ”—.

Our query will scrape all content from Google related to the word visualize but only from our Blog, blog.apify.com. All other scraping results will be filtered out. If you need to scrape specific content from a particular site, this is the shortcut to go for.

Quotation marks for exact scraping queries

#2: surround your keyword or phrase with quotation marks to scrape accurate results

#2. Surround your phrase or word with " " quotation marks for exact scraping queries

#2. Surround your phrase or word with " " quotation marks for exact scraping queries

For a regular search, Google (and Google Scraper by extension) will get content containing the words of your query in any order. But you can use quotes to make your Google scraping query laser-accurate. No similar phrases, no swapping words around, no adjacent topics, just word-by-word accuracy.

Let's see whether we can get away with this by choosing a specific, very long-tail keyword to scrape for: "Headless browsers, infrastructure scaling, sophisticated blocking. Meet the full-stack platform that makes it all easy." This whole phrase can only be found on the Apify homepage. Will the Google SERP Scraper find it?

It did! So, surrounding your scraping keyword with quotes will instruct the scraping tool to scrape Google with that specific phrase in mind. This tip can also piggyback on the previous one: you can include quotes to search for specific wording on any website. We'll come back to mixing up various tricks in tip #10.

Hyphen to exclude certain results

#3. Add - in front to exclude certain results beforehand

#3. Add - in front to exclude certain results beforehand

#3. Add - in front to exclude certain results beforehand

This shortcut is useful for cases when you want to scrape data about one topic but filter out content about another. In other words, when you don't want a specific term to show up among your Google scraped results. For example, you want to scrape information about web scraping (going slightly meta there) but exclude any Python-related pages.

You can set this up by using - in front of unwanted keywords. In our example, the hyphen instructs the Google scraping tool to ignore any content that contains the word Python. And you won't find any Python-related pages among the results. The best part about this trick is that you can filter out information that you want to keep even before you start scraping.

Link: to scrape websites with backlinks

#4. Use link: to scrape websites containing backlinks of your choice

#4. Use link: to scrape websites containing backlinks of your choice

#4. Use link: to scrape websites containing backlinks of your choice

This Google scraping tip is no.1 for all SEO enthusiasts out there. Tracking backlinks is one of the most basic SEO practices because, as a rule, the more backlinks your page has, the better your Google ranking. Even better if those backlinks are "high quality," as in coming from domains with high domain authority. Essentially, the number of backlinks is a number one indicator that your website's content is valuable (since it's trusted by websites that decide to share it).

So the gist of this Google scraping trick is: instead of just scraping a page, we're going to scrape all pages that link to that specific page. Let's extract pages with a backlink to apify.com, a.k.a all pages that mention apify.com on their page. Phew, that was a mouthful, but with a simple link: apify.com we were able to catch them all.

Keep in mind that the more targeted your query is (focusing on a specific URL, for example link: apify.com/product-matching-ai/faq), the fewer results you'll get. This happens because most pages link to the main domain page rather than specific ones.

Related: to scrape similar websites or competition

#5: use related: to scrape similar websites or competition

#5: use related: to scrape similar websites or competition

#5: use related: to scrape similar websites or competition

The related: trick is a scraping technique that could be a game-changer for market researchers. When you apply related to, let's say amazon.com, you won't scrape links to Amazon. Instead, what you'll get are links to online stores similar to Amazon. Think of any e-commerce platform, such as Walmart, Kohl's, and other retailers that sell goods online. The scraping results will depend on the domain you've chosen.

By scraping with related: you can see which companies, organizations, or other entities are perceived as competition to the page you've indicated. So you can think of this Google scraping trick as a fast way to identify competitors in a given industry at least the ones that count in a digital space.

OR to scrape Google using multiple keywords at once

#6. Use OR to scrape using multiple keywords at once

#6. Use OR to scrape using multiple keywords at once

#6. Use OR to scrape using multiple keywords at once

This Google scraping trick allows you to scrape for multiple queries at once. For instance, let's say we want to scrape pages featuring recipes for both mustard dressing and vinaigrette dressing. By placing a simple OR between these phrases, we can make sure that our search (and subsequent scraping query) includes pages containing both of these delicious terms. To make this Google scraping trick even more precise, consider using quotation marks around your queries.

Asterisk to scrape wildcard data from Google

#7. Use * asterisk to scrape wildcard data

#7. Use * asterisk to scrape wildcard data

#7. Use * asterisk to scrape wildcard data

The asterisk wildcard is another nifty trick for Google scraping. When you insert an * into your scraping query, it acts as a flexible placeholder, which the Google scraper can later fill in. This tip is particularly handy when you don't have all the words at your fingertips. To best illustrate this, let's use an example with song lyrics. So, for our example, let's search for the lyrics of a famous Queen song by taking two random parts from verse three and placing an asterisk between them.

As the scraping tool works its magic, it understands that the asterisks could represent any word or series of words bridging our queries. More often than not, the result will include the exact lyrics of the song we're targeting. But this trick isn't limited to just song lyrics. Whether it's a specific social media post, an elusive item, a lengthy name, or an article title that's on the tip of your tongue, the asterisk wildcard can make your Google scraping just a little bit more interesting.

Filetype: to scrape files of specific format

#8. Use keyword + filetype: to scrape files of specific format

#8. Use keyword + filetype: to scrape files of specific format

#8. Use keyword + filetype: to scrape files of specific format

filetype: is as simple as it sounds. This Google scraping trick will get you any file on the open web. Just enter your keyword + filetype: followed by a file extension type: PDF, DOCX, or HTML. So for example, for your scraping query harry potter filetype:pdf you'll get a collection of Harry Potter-related PDFs. But the scope of this scraping trick isn't confined to these formats alone. You can scrape Google for any type of file it accepts, including PowerPoint Presentations (PPT), LaTeX Documents (TEX), and even Google Earth maps (KML).

Scrape results before, after, and between periods of time using BEFORE, AFTER and . .

#9: scrape results before, after, and between periods of time using BEFORE, AFTER and . .

#9. Scrape results before, after, and between periods of time using BEFORE, AFTER and . .

#9. Scrape results before, after, and between periods of time using BEFORE, AFTER and . .

This trick lets you scrape Google pages in chronological order. Enter your keyword followed by the desired time frame before, after, or within a specific period. For example, if we're aiming to scrape Google Maps scraping tutorials published after 2022, our query would be: google maps scraping tutorial AFTER:2022. After applying this, our Google scraping results will exclusively feature tutorials from 2022 onwards, sparing us the effort of sifting through older, irrelevant data. A little caveat, though: you can't scrape anything earlier than the dawn of the internet.

Mix them up!

#10. Challenge the Google Pages Scraper by mixing up " ", * *, and site: search

#10. Challenge the Google Pages Scraper by mixing up " ", * *, and site: search

#10. Challenge the Google Pages Scraper by mixing up " ", * *, and site: search

#10. Challenge the Google Pages Scraper by mixing up " ", * *, and site: search

Last but not least, you can combine a lot of the scraping tricks you've just learned our Google SERP Scraper loves a challenge. In our example, we'll be looking for a very specific article that we don't fully remember the name of and narrow down our search to blog.apify.com. So we're using quotation marks, an asterisk, and a site search. Let's see if the search engine and scraper can find and get that article for us. It did! So go ahead and try out all of the tricks one by one or all at once.

๐Ÿคน Know any other tricks? Try them out on Google Scraper !

Google scraping fueled by the platform

Google scraping fueled by the Apify platform

Google scraping fueled by the Apify platform

The best part of Google Scraper is that it enables you to scrape anything and everything you could ever need from the World Wide Web. It can do that because Google SERP Scraper is more than just a standalone tool; it's actually supercharged by the versatility of the Apify platform.

Because of the platform support, you're not limited to simply exporting scraped Google data in a range of formats or getting results for various Google domains. You also gain the convenience of accessing that data through an API, crafting custom integrations with other scrapers or your favorite apps, and scheduling and monitoring your scraping projects with ease.

Last but not least, the Apify platform makes sure our 40K+ users can scrape Google pages with confidence thanks to our specialized SERP proxies that are tailor-made for the job). All this to make data extraction from Google easy and reliable.

Top comments (0)