.. LectioScraper documentation master file, created by
sphinx-quickstart on Thu Nov 2 17:38:48 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to LectioScraper's documentation!
=========================================
.. image:: twitter_header_photo_2.png
:align: left
.. toctree::
:maxdepth: 2
:caption: Contents:
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).
.. role:: raw-html(raw)
:format: html
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: :raw-html:`emil@tovborg-jensen.dk`
:raw-html:`
`
discord: Tovborg#7914
:raw-html:`
`
github: :raw-html:`Lectioscraper github`
Quick start
============
You can install lectioscraper with pip:
.. code-block:: python
pip install lectioscraper
and for installing a specific version using pip:
.. code-block:: python
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
.. code-block:: python
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
============
.. automodule:: lectioscraper.Lectio
:members:
Authors
============
Lectioscraper is developed and maintained by Emil Tovborg-Jensen.
:raw-html:`Github: Tovborg`
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:
:raw-html:`GNU General Public License v3.0`