█

AI/TLDR

Buy me a coffee
Buy me a coffee

AutoScraper

Learn web scraping rules from example data, no selectors required

Web Scraping & CrawlingOpen source
Language
Python
License
MIT
$pip install autoscraper
IN SHORT

What is AutoScraper?

AutoScraper is a Python library that builds web scrapers from examples instead of hand-written selectors. You give it a URL (or raw HTML) plus a short list of sample values you want from the page, and it figures out the rules that match those values. It sits in the Web Scraping & Crawling category of the Data & Labeling tools and is open-source, written in Python and licensed MIT.

Overview

AutoScraper is a Python library that builds web scrapers from examples instead of hand-written selectors. You give it a URL (or raw HTML) plus a short list of sample values you want from the page, and it figures out the rules that match those values. It then returns the similar elements on that page.

Once a scraper is built, you can reuse the same learned object on new URLs that share the same layout, such as other product, profile, or listing pages on the same site. The wanted data can be text, a URL, or any HTML tag value, and you can save the model to a file and load it again later.

It fits the web scraping and crawling category as a fast, dependency-light option for developers who want results quickly without writing and maintaining CSS or XPath selectors. It is compatible with Python 3 and passes parameters through to the requests module, so proxies and custom headers work out of the box.

What it does

  • Learns scraping rules automatically from a list of example values you want from a page
  • Works from a live URL or from raw HTML content you already have
  • Reuses a built scraper on new pages with similar structure via get_result_similar and get_result_exact
  • Matches text, URLs, or any HTML tag value as the wanted data
  • Passes through custom requests parameters such as proxies and headers via request_args
  • Saves and loads built models to and from a file for later reuse

Getting started

Install AutoScraper from PyPI, then build a scraper by pointing it at a URL and a few sample values you want.

Install from PyPI

AutoScraper is compatible with Python 3. Install the latest release with pip.

bashbash
pip install autoscraper

Build a scraper from an example

Pass a URL and a wanted_list of sample values. AutoScraper learns the rules and returns the similar elements on the page.

pythonpython
from autoscraper import AutoScraper

url = 'https://stackoverflow.com/questions/2081586/web-scraping-with-python'

# Add one or more candidate values you want from the page
wanted_list = ["What are metaclasses in Python?"]

scraper = AutoScraper()
result = scraper.build(url, wanted_list)
print(result)

Reuse the scraper on new pages

Apply the same learned scraper to other pages with a similar layout to pull matching content.

pythonpython
scraper.get_result_similar('https://stackoverflow.com/questions/606191/convert-bytes-to-a-string')

Save and load the model

Persist a built scraper to a file and load it back later instead of rebuilding it.

pythonpython
# Give it a file path
scraper.save('yahoo-finance')

# Later
scraper.load('yahoo-finance')

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Quickly extract repeated items like post titles, prices, or links from a page without writing CSS or XPath selectors
  • Build a reusable scraper for one site layout, then run it across many similar pages such as product or profile pages
  • Pull a fixed set of fields (for example about text, star count, and an issues link) in a known order with get_result_exact
  • Wrap a learned scraper in a small API or script to turn a website into structured data

How AutoScraper compares

AutoScraper alongside other open-source web scraping & crawling tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Firecrawl★ 214kA crawling service and API that converts whole websites into clean Markdown or structured JSON ready for LLMs.
Agent Reach★ 116kA capability layer that installs, health-checks and routes readers so a CLI agent can read and search web pages, YouTube, RSS, GitHub, Reddit, Twitter/X and more without API fees.
Scrapling★ 107kA Python web scraping framework whose parser relocates your elements when pages change, with stealthy fetchers and a Scrapy-like spider engine for full crawls.
Crawl4AI★ 88.2kA local-first Python web crawler that turns pages into clean Markdown for use in RAG and LLM pipelines.
Scrapy★ 65.7kA mature Python framework for writing fast spiders that crawl websites and extract structured data at scale.
changedetection.io★ 36.1kA self-hosted web page change monitor with XPath/CSS/jq filters, browser steps and restock alerts, which can route every diff through an LLM to suppress noise.
ScrapeGraphAI★ 33kA Python library that uses LLMs and a graph pipeline to extract data from pages based on natural-language prompts.
AutoScraper★ 8.1kLearn web scraping rules from example data, no selectors required