Skip to main content

A tool for researching and analyzing Google search page behavior and structure

Project description

Google Search Resource (GSR)

A tool for researching and analyzing Google search page behavior and structure.

Purpose

GSR is designed for legitimate research purposes:

  • Understanding how Google search pages are structured
  • Analyzing search result formatting
  • Studying how search interfaces change over time
  • Educational purposes and web development learning

Installation

From PyPI

# Install the package
pip install google-search-resource

# Install playwright browsers
playwright install chromium firefox

From Source

# Clone the repository
git clone https://github.com/yaacov/gsr.git
cd gsr

# Complete setup (create venv, install dependencies and browsers)
make setup

# Activate virtual environment
source venv/bin/activate

Usage

Command Line Interface

After installation, use the gsr command:

# Basic usage with default query
gsr

# Custom search query
gsr --query "machine learning"

# Headless mode (no browser window)
gsr --headless --query "python web scraping"

# Get help
gsr --help

Available CLI Options

gsr [OPTIONS]

Options:
  --query, -q TEXT          Search query
  --headless                Run browser in headless mode
  --new-session             Force create new session
  --session-id TEXT         Use specific session ID
  --typing [fast|normal|slow]  Typing speed style
  --max-results INT         Maximum results to display
  --verbose, -v             Increase verbosity (-v: INFO, -vv: DEBUG)
  --quiet                   Suppress all output except results
  --timeout INT             Timeout in seconds
  --browser [chromium|firefox]  Browser to use
  --output-format [text|json|csv]  Output format
  --no-images               Disable image loading
  --config PATH             Load configuration from YAML/JSON file

Usage Examples

Library Usage

from gsr.searcher import HumanLikeGoogleSearcher
from gsr.enums import SearchStatus

# Simple search with defaults
searcher = HumanLikeGoogleSearcher()

try:
    result = searcher.search("python programming")
    
    if result.status == SearchStatus.SUCCESS:
        for r in result.results:
            print(f"{r['title']}: {r['url']}")
    
    elif result.status == SearchStatus.CAPTCHA_DETECTED:
        print("Rate limit reached - stopping research")
        
finally:
    searcher.close()

Development

Setup for Contributors

# Clone and setup
git clone https://github.com/yaacov/gsr.git
cd gsr

# Install with dev dependencies
make install-dev
make install-browsers

# Code quality tools
make format        # Auto-format code
make lint          # Check code style
make format-check  # Check formatting without changes

Building and Publishing

# Build package
make build

# Test on TestPyPI
make publish-test

# Publish to PyPI (production)
make publish

License

MIT License - Copyright (c) 2025 Yaacov Zamir

For educational and research purposes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_search_resource-0.0.2.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_search_resource-0.0.2-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file google_search_resource-0.0.2.tar.gz.

File metadata

  • Download URL: google_search_resource-0.0.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for google_search_resource-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0864f0dc1c8517e39982180553f3b07ae8dfeff36b43d440025600bc2c4dc692
MD5 0b99926153176960bbe19caf3a2619ce
BLAKE2b-256 32287c0ca702edd7a6c742d880940fcb953e41182a15a178f64233813dddc579

See more details on using hashes here.

File details

Details for the file google_search_resource-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for google_search_resource-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bee976d5a6bb1fca261b0711890128cb692d26221b7f0851038344641f61b1cf
MD5 9b4771839b6cf1a335948d1c511c829f
BLAKE2b-256 cd0e0b09a0991c066269f7d411831d8dc6e9525a072745ae8b533d952c5cd131

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page