• Stars
    star
    1,421
  • Rank 33,108 (Top 0.7 %)
  • Language
    Python
  • License
    Other
  • Created over 1 year ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ‘» Experimental library for scraping websites using OpenAI's GPT API.

scrapeghost

scrapeghost logo

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

Source: https://github.com/jamesturk/scrapeghost

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

Issues: https://github.com/jamesturk/scrapeghost/issues

PyPI badge Test 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.

More Repositories

1

jellyfish

πŸͺΌ a python library for doing approximate and phonetic matching of strings.
Jupyter Notebook
2,025
star
2

django-honeypot

🍯 Generic honeypot utilities for use in django projects.
Python
360
star
3

spatula

A modern Python library for writing maintainable web scrapers.
Python
244
star
4

scrapelib

⛏ a library for scraping unreliable pages
Python
208
star
5

django-markupfield

πŸ“‘ a MarkupField for Django
Python
194
star
6

django-brainstorm

❌ deprecated brainstorm idea voting app
Python
59
star
7

django-layar

❌ deprecated helper for publishing data to Layar augmented reality browser from Django
Python
34
star
8

saucebrush

experiment in writing a simple data processing toolkit in python
Python
18
star
9

glftfont

πŸ”‘ simple library/example for using Freetype fonts within OpenGL
C++
16
star
10

cjellyfish

🎐 C implementations of Jellyfish's algorithms [deprecated]
C
14
star
11

django-markupwiki

❌ deprecated version of a simple django wiki based on django-markupfield
Python
10
star
12

polipoly

❌ deprecated simple library for dealing with political boundaries as defined by census.gov shapefiles
Python
9
star
13

mongoprof

πŸ•΅ command line mongo profiling utility
Python
6
star
14

oyster

❌ deprecated attempt to build proactive document cache
Python
6
star
15

jellyfish-testdata

🎐 cross-language test data for string comparison/encoding algorithms
3
star
16

gcr-cli

CLI for working with GitHub classroom repositories.
Python
3
star
17

go-jellyfish

🎐 a Go library for doing approximate and phonetic matching of strings
Go
3
star
18

graveyard

⚰ pieces of code that accumulate along the way
Python
2
star
19

dotfiles

βš™
Shell
2
star
20

ansible-django-uwsgi-nginx

simple django-uwsgi-nginx ansible role
2
star
21

django-simplekeys

πŸ”‘ simple but flexible API keys
Python
1
star
22

scad-designs

OpenSCAD
1
star
23

slack-render

render slack backups as static HTML
JavaScript
1
star
24

cookiecutters

template for creating a python package to my liking
CSS
1
star
25

photon

❌ obsolete ctypes+SDL experiment
Python
1
star
26

cpp_photon

❌ obsolete C++ API for development of OpenGL accelerated applications/games
1
star
27

rust-jellyfish

🎐 a Rust library for doing approximate and phonetic matching of strings, based on Python library of the same name
Rust
1
star
28

zengine-gewi

❌ deprecated GUI library written to use ZEngine
1
star
29

zengine

❌ obsolete 2D game API using OpenGL for fast 2D drawing and SDL for everything else
1
star
30

tripod-lambda

really lightweight scaffolding for AWS Lambda
Python
1
star
31

python-disqus

❌ obsolete python client library for Disqus 1.1 API
Python
1
star