Skip to main content

A simple scraper for finding guns, according to search criteria, from Swedish gun shops

Project description

GunScraper

A simple scraper for finding guns, according to search criteria, from Swedish gun shops.

Currently three shops are supported:

Setup

In order to install and setup GunScraper, follow the steps below:

  1. Create a virtual environment
  2. Install GunScraper and dependencies: pip install gun_scraper
  3. Download the configuration template misc/config.yaml
  4. Update the configuration
  5. Download misc/runner.sh and edit it with the path to the virtual environment and config file
  6. Create a Cron Job to run runner.sh at desired interval

Example Cron Job, running every 12th hour:

0 */12 * * * <path-to-repo>/GunScraper/runner.sh >/tmp/stdout.log 2>/tmp/stderr.log

Config

The config.yaml follows the following syntax:

scraper:
  filters:
    # Dictionary defining which filters to apply
    caliber: # Possible values: 22lr, 22WMR or 308win
    handedness: # Possible values: left
  sites:
    - # List defining which sites to scrape. Supported values: 'torsbo', 'jg' and 'jaktmarken'

email:
  sender: # email address that will appear as sender of the notification emails
  receiver: # email that will receive notification emails
  smtp_server: # hostname of smtp server used to send notifications
  ssl_port: # SSL port of the 'smtp_server'
  username: # username for the 'smtp_server'
  password: # password for the 'smtp_server'
  alive_msg_interval: # interval (in hours) to send notification in case no guns matching search criteria is found

data_folder: # folder to store persistent data in
logs_folder: # folder to store log output in

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

gun_scraper-0.2.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

gun_scraper-0.2.1-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file gun_scraper-0.2.1.tar.gz.

File metadata

  • Download URL: gun_scraper-0.2.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.1 Darwin/22.4.0

File hashes

Hashes for gun_scraper-0.2.1.tar.gz
Algorithm Hash digest
SHA256 629d41e7f786444e3322f76785abf6482ed9057ccc38be1d286ade5465ea82dd
MD5 dfdaabcb4bfddd1f34298d2231ed6b58
BLAKE2b-256 295c2fb749965670a8369375e904b5c688af6d9e231cd41c1c68d8ed96de5d04

See more details on using hashes here.

File details

Details for the file gun_scraper-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: gun_scraper-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.1 Darwin/22.4.0

File hashes

Hashes for gun_scraper-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1fb1da1edd20356434cfcdfe28f980d4e52dfa80e892e7c8c5f7a3967f34ba7f
MD5 9e4c904560c0e5779a0b74ec7ead6633
BLAKE2b-256 ef5891e2cb2a31626ee53a402719a998c546686fa118883b88b45a4f16bae3fc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page