shivay-at-pieces / parsera-pieces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

📦 Parsera with Pieces

Screen.Recording.2024-08-21.at.8.24.28.PM.mov

Fork of Parsera - Lightweight Python library for scraping websites with LLMs, specifically using Pieces QGPT endpoint.

Why Parsera with Pieces?

Because it's simple and lightweight, with minimal token use which boosts speed and reduces expenses.

Installation

pip install parsera-pieces
playwright install

Basic usage

You can do this from python with:

from parsera_pieces import Parsera

async def main():
       url = "https://code.pieces.app/blog"
       elements = {
           "Blog Title": "Title of the blog",
           "Blog Author": "Author of the specific blog post",
           "Published Date": "Date when the project was published",
       }

       scraper = Parsera(None)
       result = await scraper.arun(url=url, elements=elements)
       print(result)

if __name__ == "__main__":
       import asyncio
       asyncio.run(main())

About

License:GNU General Public License v2.0


Languages

Language:Python 100.0%