You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

gallerycrawler

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gallerycrawler

Generic crawling for web galleries

0.1.0
pipPyPI
Maintainers
1

gallerycrawler

https://github.com/idlesign/gallerycrawler

|release| |lic|

.. |release| image:: https://img.shields.io/pypi/v/gallerycrawler.svg :target: https://pypi.python.org/pypi/gallerycrawler

.. |lic| image:: https://img.shields.io/pypi/l/gallerycrawler.svg :target: https://pypi.python.org/pypi/gallerycrawler

Description

Generic crawling for galleries

  • Crawler starts from gallery listing URL;
  • It visits every details page mentioned on current listing page;
  • It gathers information from each details page;
  • It moves to the next listing URL.
  • Etc.

.. code-block:: python

from galerycrawler.toolbox import Crawler, dump

# Define crawler.
class MyCrawler(Crawler):

    selector_listing_next: str = '.page-next a'
    selector_listing_thumbnails: str = '.thumbnail img'
    selector_details: str = '.page-details a'
    selector_details_title: str = '.page-title'
    selector_details_img: str = '.image img'
    selector_details_author: str = '.image-author'

# Run dumping.
dump(
    crawler=MyCrawler,
    url='https://mysite.some/gallery/',
    fpath='dumped.html',
    probe=True,  # Use this to quick test your crawler
)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts