Skip to content

Commit 88dfb13

Browse files
authored
Added readme.md for backend/seleniumScript
The readme explains how to run the selenium scripts.
1 parent 88f1b9c commit 88dfb13

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Diff for: backend/seleniumScript/readme.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Instructions to run the scripts
2+
3+
### 1. Install selenium on your PC
4+
5+
```
6+
$ pip install selenium
7+
```
8+
> Make sure it installs selenium for python 3 rather than python 2
9+
10+
### 2. Install geckodriver
11+
12+
```
13+
$ wget https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
14+
$ tar -xvzf geckodriver*
15+
$ export PATH=$PATH:/path-to-extracted-file/geckodriver
16+
```
17+
> path-to-extracted-file must be filled in manually
18+
19+
Gecko Driver is needed to run the firefox browser using selenium
20+
21+
### 3. Test selenium
22+
23+
caltest.py checks how long it takes to return the calorie value of a food item(by default it checks coffee) and
24+
stores the calorie value in a json file.
25+
26+
```
27+
python3 caltest.py
28+
```
29+
30+
### 4. Scrapping the webpage
31+
32+
foodcal.py scraps the whole webpage and returns the calorie value of all food item and then stores it in a json file
33+
34+
```
35+
python3 foodcal.py
36+
```
37+
> This program will stop working in-between because the webpage is poorly written and hence making it difficult for the program to get information properly.

0 commit comments

Comments
 (0)