You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-1Lines changed: 32 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,8 @@ pip install -r requirements.txt
27
27
28
28
## Usage
29
29
30
-
To run the scraper, simply run:
30
+
First, [set up authentication](#Authentication).
31
+
Then, to run the scraper, simply run:
31
32
32
33
###### Mac/Linux
33
34
```bash
@@ -43,6 +44,36 @@ The scraper will output a JSON file called `data.json` in the same directory as
43
44
44
45
You can modify the scraper to scrape other terms by changing the `year`, `quarter`, and `college_code` variables in `src/config.py`.
45
46
47
+
#### Authentication
48
+
49
+
Since the term master schedule is only accessible to logged-in Drexel students, to run the scraper, you will need to provide your Drexel credentials as well as provide multi-factor authentication (MFA).
50
+
51
+
To provide your Drexel credentials, set the environment variable `DREXEL_USERNAME` to your Drexel username (abc123) and `DREXEL_PASSWORD` to the password you use to login to Drexel One. You can follow [this](https://phoenixnap.com/kb/windows-set-environment-variable) guide for Windows, and [this](https://phoenixnap.com/kb/set-environment-variable-mac) guide for MacOS to set environment variables.
52
+
53
+
There are two ways to provide MFA for the script to authenticate with. The first is easier if you're looking to run the script manually and quickly. The second is better if you are going to be running the script frequently, or if it needs to be automated.
54
+
55
+
###### Authenticate manually
56
+
57
+
You will authenticate the scraper manually as if you were logging into Drexel One, using a one-time code either from an authenticator app or that is texted to you. After setting the `DREXEL_USERNAME` and `DREXEL_PASSWORD` environment variables, run the scraper as explained [above](#Usage), and you will be prompted for your verification code.
58
+
59
+
###### Authenticate using a secret key
60
+
61
+
If you set this up, you will not need to manually enter an authentication code each time you run the scraper.
62
+
63
+
1. Go to [connect.drexel.edu](connect.drexel.edu).
64
+
2. Click 'Help & Settings', then 'Change MFA settings'.
65
+
3. Log in to the Microsoft portal, then click 'Add sign-in method' on the 'Security info' tab.
66
+
4. Select 'Authenticator app' for the method, and click 'Add'.
67
+
5. Select 'I want to use a different authenticator app', and then 'Next'.
68
+
6. Select 'Can't scan image?' when prompted with a QR code, and you should see an Account name and Secret key.
69
+
7. Set your `DREXEL_MFA_SECRET_KEY` environment variable to the given Secret key.
70
+
8. Select 'Next', you should be prompted to enter an authentication code.
71
+
9. With the secret key environment variable set, run `python3 src/totp.py` which will generate a one-time code.
72
+
10. Enter this code into the Microsoft website, and select 'Next'
73
+
11. 'Authenticator app' with TOTP should have been added to the list of available methods.
74
+
75
+
Now, when you run the scraper as explained [above](#Usage), it should authenticate itself automatically using this secret key.
76
+
46
77
#### All Colleges
47
78
48
79
To scrape all colleges instead of just the one specified in the `src/config.py`, run the following command:
0 commit comments