K
K
Kalante2020-10-05 23:09:28
Python
Kalante, 2020-10-05 23:09:28

How to implement schedule parsing for telegram bot (aiogram)?

Please help me to realize this idea.
There is a periodically updated schedule of the educational institution, which looks like:

Example

┌────┬──┬──────────────────────────────────┐

│ │ │ │

│No │No├──────────────┬───┬───────────────┤

│гр. │ур│ Предмет │Ауд│ Преподаватель │

├────┼──┼──────────────┼───┼───────────────┤

│31А │ 2│Химия │ 29│Глекова ВН │

│ │ 3│Рус язык │321│Кутаева ОА │

│ │ 4│Иностран яз │363│Красовская СВ │

│ │ │Иностран яз │209│Бедненко АБ │

│ │ │Иностран яз │ 23│Долматова ТС │

├────┼──┼──────────────┼───┼───────────────┤

│26ГП│ 2│Бел лит │349│Барташевич ВИ │

│ │ 3│Физика │ 22│Гамза АА │

│ │ 4│Химия │ 29│Глекова ВН │

├────┼──┼──────────────┼───┼───────────────┤

│31Э │ 1│Химия │ 29│Глекова ВН │

│ │ 2│Иностран яз │363│Красовская СВ │

│ │ │Иностран яз │209│Бедненко АБ │

│ │ │Иностран яз │ 23│Долматова ТС │

│ │ 3│История РБ │ 28│Богомолов ЕЕ │
└────┴──┴──────────────┴───┴───────────────┘


The schedule itself

How is it possible to implement parsing, having previously downloaded the file with the schedule on the machine, so that the schedule of a specific group is cut out of this text. Logically, a clipping starting from the line with the name of the desired group, and ending with the name of another group. (Sorry for the tautology)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Robisho, 2020-10-21
@robisho

look for the tag where the text is the name of your group and parse this tag along the tree. everything is as usual.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question