Welcome to LectioScraper’s documentation!
LectioScraper is a python package for helping you scrape lectio.dk with ease. It uses requests for the actual scraping and beautifulsoup for parsing the html. Scraping lectio.dk can be a tedious task, as it requires so much different html elements to be parsed. and lectio is a big website so there are a lot of different pages to scrape. Here you have everything configured and all you need to do is to import lectioscraper and start scraping (see the whole documentation below).
Getting help
Maintaining a package like this is a lot of work, because lectio.dk always changes and breaks the code. And therefore I can’t guarantee that the code will work 100% of the time, but reach out if you have a problem and I’ll fix it ASAP.
If you’re familiar with BS4 and webscraping it should be pretty easy to implement a fix yourself, and I would love to see a pull request with your fix.
If you have any problems with the documentation or with the code, please feel free to contact me on my email, discord or open an issue on github. (see below).
e-mail: emil@tovborg-jensen.dk
discord: Tovborg#7914
github: Lectioscraper github
Quick start
You can install lectioscraper with pip:
pip install lectioscraper
and for installing a specific version using pip:
pip install lectioscraper==version
After installing lectioscraper you need to import the Lectio class and create an instance of the class with your login details
import lectioscraper
client = lectioscraper.Lectio(username, password, schoolId)
# after importing you can start scraping with the client object, see below for all functions
# Example:
# Scrape all classes for the current week
client.getSchedule(to_json=True)
When initializing the client you can pass the following arguments: username, password, and a so called schoolId that is found by going to your school’s page on lectio.dk and looking at the url.
Example:
https://www.lectio.dk/lectio/59/default.aspx
here the schoolId is 59, the schoolid will always be after /lectio/
Usage
License
lectioscraper is licensed under the GNU General Public License v3.0. You are free to modify and distribute as long as you give credit to the original author.
You can find the full license text either in the LICENSE file or on the following link: