<commit_before>---
title: Photo Scraper
category: Instructor
order: 9
---

This tool scrapes student photos from Rensselear's Student Information System
(SIS) portal that allows instructors to access the current and past
course registration and information (including photos) for the
students in these courses.

Unfortunately, the RPI SIS portal does not allow the instructor to
bulk download all student photos.  Thus we have created the following
command line tool to do so.

This tool will download the photos of students in the selected
terms/courses/sections into folders and name the photos with their
usernames/RCS IDs.

We welcome others to adapt or generalize this tool for use at other
institutions.


### Installation
1.  [Install Python 3](https://www.python.org/downloads/)

2.  [Install Selenium](http://selenium-python.readthedocs.io/installation.html) (in terminal/command prompt)
    ```
    pip3 install selenium
    ```

3.  Install Chromedriver (in terminal/command prompt)

    [Windows:](https://sites.google.com/a/chromium.org/chromedriver/downloads)
    ```
    Download and put chromedriver.exe in C:\Windows
    ```
    MacOS:
    ```
    brew install chromedriver
    ```
    Note: Make sure Chrome browser, Chromedriver, and Selenium are all up-to-date.

4.  Install requests
    ```
    pip3 install requests
    ```
    If using an older version of Python 3 (< Python 3.4), user may need to install requests[security].
    ```
    pip3 install requests[security]
    ```

### PhotoScraper/RPI_SIS_Photo_Scraper.py
[Download PhotoScraper/RPI_SIS_Photo_Scraper.py](https://github.com/Submitty/InstructorTools)

Run the python file in terminal/command prompt in the directory the file is located:
```
python3 RPI_SIS_Photo_Scraper.py
```
This will prompt the user to type in responses on the command-line.

### Example Photo Scraping

1.  Login to SIS
<commit_msg>tweak photo scraper instructions<commit_after>---
title: Photo Scraper
category: Instructor
order: 9
---

This tool scrapes student photos from Rensselear's Student Information System
(SIS) portal that allows instructors to access the current and past
course registration and information (including photos) for the
students in these courses.

Unfortunately, the RPI SIS portal does not allow the instructor to
bulk download all student photos.  Thus we have created the following
command line tool to do so.

This tool will download the photos of students in the selected
terms/courses/sections into folders and name the photos with their
usernames/RCS IDs.

We welcome others to adapt or generalize this tool for use at other
institutions.


### Installation

1.  [Install Python 3](https://www.python.org/downloads/)


2.  [Install PIP](https://pip.pypa.io/en/stable/installing/), the Python package manager

    [step-by-step instructions for Windows 10](https://matthewhorne.me/how-to-install-python-and-pip-on-windows-10/)


3.  [Install Selenium](http://selenium-python.readthedocs.io/installation.html) (in terminal/command prompt)
    ```
    pip3 install selenium
    ```


4.  Install Chromedriver (in terminal/command prompt)

    On Windows:
    [Download chromedriver.exe](https://sites.google.com/a/chromium.org/chromedriver/downloads)
    and put it in C:\Windows

    On MacOS:
    ```
    brew install chromedriver
    ```

    _Note: Make sure Chrome browser, Chromedriver, and Selenium are all up-to-date._


4.  Install requests

    ```
    pip3 install requests
    ```

    If you're using an older version of Python 3 (< Python 3.4), you may need to install requests[security].
    ```
    pip3 install requests[security]
    ```

### PhotoScraper/RPI_SIS_Photo_Scraper.py

[Download PhotoScraper/RPI_SIS_Photo_Scraper.py](https://github.com/Submitty/InstructorTools)

Doubleclick or run the python file in terminal/command prompt in the directory the file is located:

```
python3 RPI_SIS_Photo_Scraper.py
```

This will prompt the user to type in responses on the command-line.


### Example Photo Scraping

1.  Login to SIS

{'fraction_non_alphanumeric': 0.08609599208312717, 'fraction_numerical': 0.008164275111331025, 'mean_word_length': 3.859375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7298968', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1168, 'n_words': 441}