Ultimately, our goal will be to track book prices at Book To Scrape, an online bookstore .
version: 1.7.2
This setup is for a development environment.
Prerequisite:
- >= python3,9
Through a terminal(Debian linux) or Powershell(Windows) :
Position yourself in the local directory in which you want to position the sources of the application
cd [path_to_source_directory]- Clone the repository via the clone command in ssh mode ssh, via la commande suivante
git clone git@github.com:DelphinePythonique/projet2.git- Position yourself in the project directory, create a virtual environment
cd projet2
python -m venv env-
Activate virtual environment
If OS is Debian Linux:
source env/bin/activateIf OS is Windows:
.\env\Scripts\activate- Install the python packages useful for the script
pip install -r requirements.txt Enter the following command
python main.py --url=[book's url] --impact=bookAdd option --csv to generate a csv file in the data directory
python main.py --url=[book's url] --impact=book --csvEnter the following command
python main.py --url=[category's url] --impact=catAdd option --csv to generate a csv file in the data directory
python main.py --url=[category's url] --impact=cat --csvEnter the following command
python main.py --allAdd option --csv to generate a csv file in the data directory per category
python main.py --all --csvBefore to execute this command, you must ensure to have download csv files; indeed, this command is based on the images's urls present in the files. Enter the following command
python main.py --imagesFile's format is [book's upc].jpg