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

from rufus 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.3.tar.gz (5.1 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.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rufus_web_scraper-1.0.3.tar.gz
  • Upload date:
  • Size: 5.1 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.3.tar.gz
Algorithm Hash digest
SHA256 11e753d6ee1b54905e4b071c280e47699bd52ac8c933f8eaa0d0bab003ffdec8
MD5 2c1aee48fa2e755a5525b44aef8b892a
BLAKE2b-256 ca01f910c08c7187d8627dd766c0cb79f78ddb47eea8d75bb9974da1b3b6992b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rufus_web_scraper-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 99cf3c0dfe2bd6860d1037cf7ba1bef17b34247d7ad6ba7faa7f426f535deb6d
MD5 e40c8631dff55d1e471072b9f3546066
BLAKE2b-256 3f1d1532afc01a0c8863dd706ffb66417e64ae8457e781bdcc816a22339d5382

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