Skip to main content

A Python package for web scraping and parsing using Selenium, BeautifulSoup, and Llama LLM.

Project description

Rufus Scraper

rufus-web-scraper is a Python package for web scraping and content parsing. It combines the power of Selenium, BeautifulSoup, and LangChain Ollama to extract and process data from web pages efficiently.


Features

  • Scrape Websites: Fetch content from webpages, including nested links.
  • Clean HTML Content: Extract meaningful text by removing scripts, styles, and unnecessary elements.
  • Parse with AI: Use AI models like Ollama locally to parse scraped content based on custom prompts.
  • Customizable Depth: Scrape nested links up to a specified depth. (currently max_depth=1)

Installation

Install Rufus Web Scraper with pip:

pip install rufus-web-scraper

Setting Up Before Use

Selenium Crawler API Key

To enable the Selenium crawler, you need to create a Remote API key for crawling websites:

  1. Visit https://brightdata.com/.
  2. Sign up for a free account.
  3. Navigate to Proxies and Scraping > Click Add > Select Scraping Browser.
  4. Generate a web-crawling API key and save it.
  5. Pass the API key directly in the ".scrape" function.

Download the Llama Model Locally

To use the Llama model for parsing:

  1. Visit https://ollama.com/download.
  2. Download the Ollama setup for your platform and install it.
  3. Open Command Prompt (Windows) or Terminal (Mac/Linux).
  4. Run the following command to ensure Ollama is installed:
ollama
  1. Download the Llama3.1 model locally:
ollama pull llama3.1

Example Usage

import rufus-web-scraper
from rufus-web-scraper import RufusClient

client = RufusClient()
documents = client.scrape(url,scraper_key,prompt)
print(document)

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

rufus_web_scraper-1.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

rufus_web_scraper-1.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file rufus_web_scraper-1.0.1.tar.gz.

File metadata

  • Download URL: rufus_web_scraper-1.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for rufus_web_scraper-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e18f4437ddc31d0ce285eac8d855f37c93d5e6ab4f3615d89f058e333ec33659
MD5 81613c20cc94091f126a8e3fa665e459
BLAKE2b-256 f1298204ecd431d06831cf0d26d29dfcf57a8fded473082c73be4170343bb085

See more details on using hashes here.

File details

Details for the file rufus_web_scraper-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rufus_web_scraper-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cdbfda42c831def78077ea0e29ec75936f8b5fe08ec28feb911cd76d2e78d96e
MD5 4b8760b56b66b8ea99f6e8cc98c6e52c
BLAKE2b-256 ccfc62e32a76950e3236a3f9b76e6e1ea6d84b927d5738245e19777b1be390e2

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