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 two shops are supported: Torsbo Handels and JG Jakt.
Setup
In order to install and setup GunScraper, follow the steps below:
- Create a virtual environment
- Install GunScraper:
pip install gun_scraper
- Download
misc/runner.sh
and edit it with the path to the virtual environment - Download the configuration template
misc/config.yaml
and place it in the same folder asrunner.sh
- Update the configuration
- 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 and jg
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
logs_folder: # folder to store log data in
data_folder: # folder to store persistent data 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.1.0.tar.gz
(11.4 kB
view hashes)
Built Distribution
Close
Hashes for gun_scraper-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 258b6336061808124e125dd513290ee39d6e7205a4f8db1174e059297c551f9a |
|
MD5 | 1d6b4e55da124d09b4a9d31a0ef3d453 |
|
BLAKE2b-256 | c25b561d9216409212c574b4e7dc8cbe54a41983b91e7029a9b24124c90eb8e2 |