GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jamesturk/scrapeghost: 👻 Experimental library for scraping websites using OpenAI's GPT API.

BranchesTags
Open more actions menu

Latest commit

 

History

204 Commits
204 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
examples
examples
 
 
src/scrapeghost
src/scrapeghost
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
Justfile
Justfile
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
mkdocs.yml
mkdocs.yml
 
 
mypy.ini
mypy.ini
 
 
pyproject.toml
pyproject.toml
 
 
screenshot.png
screenshot.png
 
 

Repository files navigation

scrapeghost

This project from 2023 is no longer maintained or recommended, the author has no interest in working with commercial LLMs.

scrapeghost was an experimental library for scraping websites using OpenAI's GPT.

Source: https://codeberg.org/jpt/scrapeghost

Documentation: https://jamesturk.github.io/scrapeghost/

Issues: https://codeberg.org/jpt/scrapeghost/issues

PyPI badge

Use at your own risk. This library makes considerably expensive calls ($0.36 for a GPT-4 call on a moderately sized page.) Cost estimates are based on the OpenAI pricing page and not guaranteed to be accurate.

Features

The purpose of this library is to provide a convenient interface for exploring web scraping with GPT.

While the bulk of the work is done by the GPT model, scrapeghost provides a number of features to make it easier to use.

Python-based schema definition - Define the shape of the data you want to extract as any Python object, with as much or little detail as you want.

Preprocessing

  • HTML cleaning - Remove unnecessary HTML to reduce the size and cost of API requests.
  • CSS and XPath selectors - Pre-filter HTML by writing a single CSS or XPath selector.
  • Auto-splitting - Optionally split the HTML into multiple calls to the model, allowing for larger pages to be scraped.

Postprocessing

  • JSON validation - Ensure that the response is valid JSON. (With the option to kick it back to GPT for fixes if it's not.)
  • Schema validation - Go a step further, use a pydantic schema to validate the response.
  • Hallucination check - Does the data in the response truly exist on the page?

Cost Controls

  • Scrapers keep running totals of how many tokens have been sent and received, so costs can be tracked.
  • Support for automatic fallbacks (e.g. use cost-saving GPT-3.5-Turbo by default, fall back to GPT-4 if needed.)
  • Allows setting a budget and stops the scraper if the budget is exceeded.

About

👻 Experimental library for scraping websites using OpenAI's GPT API.

jamesturk.github.io/scrapeghost/

Topics

gptopenai-apiwebscraping

Resources

Readme
License

Code of conduct

Code of conduct
Activity

Stars

1.4k stars

Watchers

17 watching

Forks

86 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.