Skip to main content

A Python tool to scrape Google rankings of domains for given keywords using Selenium.

Project description

SEOberry

SEOberry is a Python tool that scrapes Google search results to extract the SEO rankings of websites based on given keywords. Simply provide a CSV file, and SEOberry will automatically retrieve and update the ranking positions for each domain.

Features

  • Automated Google Scraping: Uses Selenium to fetch Google search results.
  • Domain Ranking Extraction: Identifies and ranks domains found in search results.
  • CSV Integration: Updates CSV files with ranking data.
  • Customizable CLI: Run the tool with custom input/output file names.
  • Captcha Handling: Prompts you to solve captchas when detected.

Requirements

Installation

You can install SEOberry via pip (once published on PyPI):

pip install seoberry

Alternatively, if you want to install it from the source, clone the repository and run:

git clone https://github.com/hamidrezafarzin/SEOberry.git
cd SEOberry
pip install -e .

Usage

SEOberry provides a command-line interface (CLI). The basic usage is:

seoberry -i input.csv -o output.csv

Where:

  • -i or --input specifies the path to your input CSV file.
  • -o or --output specifies the path to the output CSV file where the results will be saved.

You can also print an example of the required CSV header format by running:

seoberry --example-header

help command :

seoberry --help

Example Command

python -m seoberry.cli -i my_keywords.csv -o my_results.csv

Attention (captcha) !

After every 100 searches, Google usually triggers a captcha that you need to solve. To avoid frequent interruptions, it's best to run searches in batches of 90 to 100 to minimize captcha challenges. Once you solve the captcha, press the Enter key in the open terminal.

CSV Format

Your input CSV file must have a column named Keyword. All additional columns should contain website addresses whose rankings you want to track.

Here’s an example of the expected CSV format:

Keyword,Site1.com,Site2.com,Site3.com
"best laptops",,,
"top smartphones",,,
  • Keyword: Contains the search term.
  • Site1.com, Site2.com, ...: Columns with website URLs. SEOberry will extract the domain and determine its rank in the search results.

Acknowledgments

Special thanks to Reza Najibi (SEO Specialist) for his insightful idea and invaluable assistance in developing and refining this module. Your support and collaboration have been truly appreciated!

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.

License

This project is licensed under the MIT License.

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

seoberry-1.0.4.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

seoberry-1.0.4-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file seoberry-1.0.4.tar.gz.

File metadata

  • Download URL: seoberry-1.0.4.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for seoberry-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d64e98eb462cf82cd9978446aa0f1502b163f01c77880d84c97b6f879a2aff94
MD5 f69bee3b445fb242ac824b21bf41e478
BLAKE2b-256 6e5eb0b0af9172ff477d0f1be2a2ebd9388e6902927ad85a4291fe9bb6588379

See more details on using hashes here.

File details

Details for the file seoberry-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: seoberry-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for seoberry-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a5248d2658c9e698788478e5e45c78e46accb2ccbff8665d71d3dde4a944b951
MD5 f184b8a69ac46fd0d4c7c1d9cc0de206
BLAKE2b-256 2a13e4bd8da806623e8ba3f36aac4869818ab0cf54adc5e92bcda842104c4049

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