fix schedule

This commit is contained in:
2022-04-25 13:16:30 +07:00
parent b68fedb1b6
commit 17e05636a5
3 changed files with 14 additions and 2 deletions
+12
View File
@@ -0,0 +1,12 @@
package main
import (
"fmt"
"student_bot/date"
"student_bot/parser"
)
func main() {
lessons := parser.ParseByDay(date.Today())
fmt.Println(lessons)
}
+1 -1
View File
@@ -46,7 +46,7 @@ func parse() []Lesson {
k := 0
var lessons []Lesson
var l Lesson
doc.Find(".schedule tr>td, .schedule tr>td[width=\"100%\"]").Each(func(i int, s *goquery.Selection) {
doc.Find(".schedule_table tr td").Each(func(i int, s *goquery.Selection) {
text := strings.TrimSpace(s.Text())
if strings.Contains(text, "Понедельник") ||
strings.Contains(text, "Вторник") ||