Skip to main content

A tiny web scraping library

Project description

Truelle

Truelle - "trowel" in french - is a tiny web scraping library, inspired by the great Scrapy framework, depending only on Requests, and Parsel libraries.

Truelle only offers a sequential request processing, and returns items directly It's intended to be embedded in tiny scripts. Spiders aims to be compatible with Scrapy spider and easily switch to a Scrapy.

Install

pip install truelle

Get started

  1. Create a Spider
from truelle import Spider

class MySpider(Spider):
    start_urls = [ "https://truelle.io" ]
    
    def parse(self, response: Response):
        for title in response.css("h1::text").getall():
            yield { "title": title }
            
spider = MySpider() 
  1. Then get your items back...

... in vanilla Python:

for item in spider.crawl():
    do_something(item)

... in a Pandas dataframe:

import pandas as pd
my_df = pd.DataFrame(spider.crawl())

Custom settings

def custom_fingerprint(request):
    return "test"

custom_settings = {
    "HTTP_CACHE_ENABLED": True,
    "REQUEST_FINGERPRINTER": custom_fingerprint,
    "HTTP_PROXY": "http://myproxy:8080",
    "HTTPS_PROXY": "http://myproxy:8080",
    "DOWNLOAD_DELAY": 2
}

spider.crawl(settings=custom_settings)

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

truelle-0.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

truelle-0.0.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file truelle-0.0.1.tar.gz.

File metadata

  • Download URL: truelle-0.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.9 Darwin/21.2.0

File hashes

Hashes for truelle-0.0.1.tar.gz
Algorithm Hash digest
SHA256 289289bfb2229175f214604125d24f9acc233a3a6d508ccd4d0d706b52889a69
MD5 92c91a0f70989195d306a573591d1719
BLAKE2b-256 c9f168a9b1ef629f5f2e4af8d16d94689da6d462974e733a4c4d6b879081447c

See more details on using hashes here.

File details

Details for the file truelle-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: truelle-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.9 Darwin/21.2.0

File hashes

Hashes for truelle-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 937dcc40e74c327df57a2b249f14b21a19fb131237720a6bacabec91eb0ab36e
MD5 f6242136c1619ec451bd970800c58188
BLAKE2b-256 040accab82981a2d599358d71dca64285ea6bbe7c2571e2f949423e9ff097273

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