Skip to main content

Bing Search Scraper - A Python library for retrieving search results from Bing

Project description

Bing Search Scraper

Overview

Easily scrape Bing search results using Python. This library leverages requests for making HTTP requests and BeautifulSoup for parsing HTML content. It offers both synchronous and asynchronous functionality for efficient retrieval of results.

Installation

Install via pip:

pip install bing-results-scraper

Usage

Synchronous Usage:

from bing_results_scraper import BingScraper

# Create a scraper instance
bing = BingScraper() #headers=Optional(default header will be used), max_retries=Optional(default: 3), num_results=Optional(default: 10)

# Fetch results for a single query
results = bing.get_results(q='Query')

# Access the results
print(results['organic_results'])

Asynchronous Usage:

from bing_results_scraper import AsyncBingScraper

# Create an asynchronous scraper instance
async_bing = AsyncBingScraper()#headers=Optional, max_retries=Optional(default: 3), num_results=Optional(default: 10), error_sleep=Optional(default: 1)

# Fetch results for multiple queries
queries = ['Query 1', 'Query 2', 'Query 3']
results = async_bing.get_results(queries)

# Access the results for each query
for result in results:
    print(result['organic_results'])

Features

  • Synchronous and asynchronous scraping options
  • Customizable headers
  • Automatic query URL encoding
  • Response status handling
  • Retries for failed requests
  • Parsed organic result data extraction
  • Clear output structure

Contributing

Contributions are welcome! Please follow the standard fork-and-pull request workflow on GitHub.

Author

Renukumar R

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

bing-results-scraper-0.4.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

bing_results_scraper-0.4.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file bing-results-scraper-0.4.1.tar.gz.

File metadata

  • Download URL: bing-results-scraper-0.4.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for bing-results-scraper-0.4.1.tar.gz
Algorithm Hash digest
SHA256 d8f572645212e0f243cb852606a74defa8a43d08fa5ff4830414fcef481a43ce
MD5 9c26ff07271ffd6988a5754bb476840a
BLAKE2b-256 c50071ae2021d2156c620e31b3f55db61ed24f605322ac6214b75cc58a133bae

See more details on using hashes here.

File details

Details for the file bing_results_scraper-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for bing_results_scraper-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92185836be09d02203fbe88927e41ba3f95051457968778fe9004918322efae5
MD5 7d98f723b38ad49cd7010105052a503b
BLAKE2b-256 6b4813f5c824ef5463b7dbc7a61bccc244ed34f42cd50a63c2f84a1707721fcb

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