scraper for ilias platform of of the uni constance
Project description
iliasScraper: revised
Package is still in development, so make sure you have the latest version installed or update via:
pip install iliasScraper --upgrade
iliasScraper is as the name already states, a web scraper which downloads your
materials from any Ilias course. Designed for the university Constance and written in python.
The folder structure from the Ilias course is kept!
My initial approach can be found here: MisterXY89/iliasSpider. However this is outdated and doesn't really work anymore. Further this scraper
now supports:
- keep-structure of the ilias course
- recursively finding all folders, not only custom specified ones
- specicy a target dir
- CLI and package mode
- file extension detection
- sessions/sitzungen are now supported
This package uses the old request
and bs4
, instead of scrapy
.
There is a fork of my old approach mawenzy/iliasSpider which is actively maintained, if you prefer scrapy.
For password storing I'll be using the keyring
package.
The CLI-mode does currently only support linux-systems.
Install
pip3 install iliasScraper
or clone, cd into folder and pip3 install .
.
MacOS
To get it working on a mac you need Python 3.9.4
,
Usage
There are two modes: the package and the cli mode. Both modes download all files for the respective course in the current directory.
Package
from iliasScraper import scraper
# your Ilias username, without the @uni-konstanz.de ending
username = "tilman.kerl"
# this is used to identify and later run the configured scraper
course_name = "Bsc Seminar" # -> will be changed to bsc_seminar
# your course url
url = "https://ilias.uni-konstanz.de/ilias/goto_ilias_uni_crs_1078392.html"
# if target_dir is not set, the current path is used
# an absolute path has to be used
target_dir = "/home/dragonfly/Documents/Uni/WS201"
sc = scraper.Scraper(
url = url,
name = course_name,
target_dir = target_dir
)
# setup your scraper, on your first usage you will be asked for a password
# if the user is set to "" or something not valid, you will be prompted
# an input to enter your username
sc.setup(username)
# this then runs the scraper and downloads all files and folders in the
# target directory
sc.run()
# if you choose to store your password previously and want to remove it,
# you can simply to so via
sc.remove_password(username)
CLI
Usage: iliasScraper [OPTIONS] COMMAND [ARGS]...
CLI for the ilias-scraper
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
create Create a new scraper with a url and name
list List all existing scraper
remove-password Remove the stored password
run Run a previously created scraper
Example usage
Mac
For Macs the creation is a little different:
# the url needs to be put in quotes
iliasScraper create --url "https://ilias.uni-konstanz.de/ilias/goto.php?target=crs_1186878" --username tilman.kerl --course-name "Vertragsrecht" --target-dir "/Users/tilman/Desktop/UNI/Jura"
Linux
# create a new scraper like this, the name will be changed to "bsc_seminar"
# the scraper will be stored in ~/.iliasScraper/
# the target_dir has to be an ABSOLUTE PATH!
$ iliasScraper create --url https://ilias.uni-konstanz.de/ilias/goto_ilias_uni_crs_1078392.html --username tilman.kerl --course-name "bsc seminar" --target-dir /home/dragonfly/Documents/Uni/WS201
> Scraper 'bsc_seminar' has been created!
# you can now run the scraper via
$ iliasScraper run --name bsc_seminar
# to list all currently configured scraper
$ iliasScraper list
> Currently configured scrapers:
> - bsc_seminar.py
# if you choose to store your password previously and want to remove it,
# you can simply to so via
$ iliasScraper remove-password --username tilman.kerl
> The password for tilman.kerl has been removed!
Requirements
bs4
requests
fleep
tqdm
colorama
keyring
click
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file iliasScraper-0.1.8.tar.gz
.
File metadata
- Download URL: iliasScraper-0.1.8.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06c846036e67199324ab70edbab145907d66d5b6d91a2b6be7b1c40c2df43ed2 |
|
MD5 | 52ab65914b529a7517ba71b48026b582 |
|
BLAKE2b-256 | 26ffc987e2e17aede31469f64b023c0f9c4a1c411b41cfc8c7821db303725e46 |