Registry / http-networking / google

google

JSON →
library3.0.0pypypi✓ verified 21d ago

This library provides Python bindings for performing web searches on Google.com by directly scraping the search results pages. It is important to note that this is NOT an official Google product or API. Its functionality relies on parsing the HTML structure of Google's search results, making it highly susceptible to breaking changes if Google alters its website layout. Users should be aware of potential rate limiting and IP blocking from Google.

pip install google
INSTALL
IMPORT
SIG · GOOGLE
G
google
http-networkingpythonv3.0.0
Install
1.9s avg
Import
285ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.294s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.9s · import 0.276s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

search
from googlesearch import search
from google import search

This quickstart demonstrates how to perform a basic Google search using the `search` function. It includes a `pause` parameter to mitigate the risk of IP blocking from Google, which is a common issue with web scraping libraries.

import time from google import search search_query = "checklist.day Python libraries" print(f"Searching for: '{search_query}'") # Perform a search for 5 URLs, with a 2-second pause between requests # to avoid IP blocking. Adjust parameters as needed. try: for i, url in enumerate(search(search_query, tld="com", lang="en", num=5, start=0, stop=5, pause=2.0)): print(f"Result {i+1}: {url}") except Exception as e: print(f"An error occurred: {e}") print("Consider increasing the 'pause' time or checking your network connection.")
Debug
Known issues
breakingThis library scrapes Google's website. Any changes to Google's search result page HTML structure (which happens frequently) will break the library's functionality. There is no guarantee of continuous operation.
fix
Monitor library updates; be prepared for breakage. Consider using official Google Search APIs for reliable, long-term solutions.
affects: All versions
gotchaThis is NOT an official Google product or API. It's a third-party scraping tool. Do not confuse it with official Google Cloud APIs (e.g., Custom Search API) which offer more robust and legal ways to access search data.
fix
If you require official Google services, use Google's own client libraries (e.g., `google-api-python-client`) and their respective APIs after setting up a Google Cloud Project.
affects: All versions
gotchaFrequent or rapid requests will lead to your IP being temporarily or permanently blocked by Google. The `pause` parameter helps, but aggressive usage is still risky.
fix
Use the `pause` parameter between requests (e.g., `pause=2.0`). Implement exponential backoff for retries. Avoid making large volumes of requests from a single IP address.
affects: All versions
Upgrade
Version history
3.0.0latest on PyPI · released Jul 11, 2020
Audit
Dependencies
requestsrequiredFor making HTTP requests to Google's servers.
beautifulsoup4requiredFor parsing the HTML content of Google's search results.
Agent activity
11 hits · last 30 days
node
10
Resources
google — pip install google · libregistry