From dce711072c3d476ca6213d53c8316a7b60d59a1e Mon Sep 17 00:00:00 2001 From: far-galaxy Date: Mon, 31 Jul 2023 13:00:40 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5:=20=D0=BF=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D1=85=D0=BD=D0=BE=D1=81=D1=82=D0=BD=D1=8B=D0=B9=20=D0=BF?= =?UTF-8?q?=D0=B0=D1=80=D1=81=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/ssau_parser/parser.go | 5 ++++- modules/ssau_parser/ssau_parser_test.go | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/modules/ssau_parser/parser.go b/modules/ssau_parser/parser.go index a91d125..5a8bd3d 100644 --- a/modules/ssau_parser/parser.go +++ b/modules/ssau_parser/parser.go @@ -75,7 +75,10 @@ func Parse(p Page) (*WeekShedule, error) { var lessons [][]Lesson doc.Find(".schedule__item:not(.schedule__head)").Each(func(i int, s *goquery.Selection) { - sl := ParseLesson(s, p.IsGroup, p.ID) + //sl := ParseLesson(s, p.IsGroup, p.ID) + sl := []Lesson{ + {}, + } lessons = append(lessons, sl) }) diff --git a/modules/ssau_parser/ssau_parser_test.go b/modules/ssau_parser/ssau_parser_test.go index 24c7ab3..8ab7928 100644 --- a/modules/ssau_parser/ssau_parser_test.go +++ b/modules/ssau_parser/ssau_parser_test.go @@ -72,3 +72,27 @@ func TestDownloadShedule(t *testing.T) { log.Println(err) } } + +func TestParse(t *testing.T) { + headURL = "http://127.0.0.1:5000" + page, err := DownloadSheduleById(530996168, true, 1) + if err != nil { + log.Println(err) + } + _, err = Parse(page) + if err != nil { + log.Println(err) + } + + for i := 1; i < 6; i++ { + page, err := DownloadSheduleById(123, true, i) + if err != nil { + log.Println(err) + return + } + _, err = Parse(page) + if err != nil { + log.Println(err) + } + } +}