Skip to main content

PyBingScrapper

Python wrapper for Bing Search results.

Implementation

pip install PyBingScrapper

Below is a simple example for running the library

from PyBingScrapper.search import BingSearch

bing = BingSearch("Narendra Modi")
#num - num of results to return
#max_lines - maximum number of lines/sentences to return in each result

bing_results = bing.get_results(num=4, max_lines=15)
# bing_results[i]['content'] - scrapped content
# nlines - num of iterations
# hfkey - hugging face secret key

print(bing.rag_output("Tell me about Mr. Narendra Modi?", bing_results, hfkey, n_iters=15)) #n_iters-optional

To only scrape results from the web use the below code snippet

bing = BingSearch("Narendra Modi")
bing_results = bing.get_results(num=4, max_lines=15)

# the above code provides the top 4 results from bing search with 15 sentences from each result as content

To implement RAG algorithm over the query use the below. RAG - RAG is a framework/algorithm to improve LLM-generated responses by leveraging external information such as Wikipedia information etc for the queried prompt.

print(bing.rag_output(bing_results, hfkey, n_iters=15))

Release files for PyBingScrapper 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyBingScrapper 1.0.3
File Size Uploaded
PyBingScrapper-1.0.3.tar.gz 5.6 kB Details

Release files / PyBingScrapper-1.0.3.tar.gz

Download URL PyBingScrapper-1.0.3.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8473f064fd9679ad4833c9f8352c160811a9ed8d94f36f565002bed5d2f528b6
BLAKE2b-256 checksum
How to use checksums
b53c41861b46c8bc4039d7b6e3c57cae28cb53cb84c326f0375fe205d5ef1778
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.0.8

1 release file

0.0.7

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page