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), hits_at_a_time=Optional(default: 30)
# 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
- LinkedIn: https://www.linkedin.com/in/renukumar-r/
- GitHub: https://github.com/Renukumar-R
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bing_results_scraper-0.5.0.tar.gz
.
File metadata
- Download URL: bing_results_scraper-0.5.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe48ac0b84a534ae96fdbc24408d03425b8b0b79dc0b66ffe582d194666b7c28 |
|
MD5 | 0fa34b6a3fcb8d36849f51eb0ac26c9d |
|
BLAKE2b-256 | bb9f0c740a05f909f8fa91e867eb123e941ccff383aeb6610756470387e114f7 |
Provenance
File details
Details for the file bing_results_scraper-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: bing_results_scraper-0.5.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1b6ea0bcf251a9d60b9986238f603ed21bd0655197cd9f35a1f44398af29b7a |
|
MD5 | 7395127b352c362062502b9eeb6f67d7 |
|
BLAKE2b-256 | f81093b9ff559c1ded6e6aab7e072af0dae601313ffbb95a727ed19bc5d13d31 |