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, 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))

# 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.3.1.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

bing_results_scraper-0.3.1-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

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