Skip to content

Commit 61ae968

Browse files
committed
Fixed sectionParser bug and made headless no longer default
1 parent d78c5ea commit 61ae968

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func main() {
5858
verbose := flag.Bool("verbose", false, "Enables verbose logging, good for debugging purposes.")
5959

6060
// Flag for headless mode
61-
headless := flag.Bool("headless", true, "Enables headless mode for chromedp. Defaults to true.")
61+
headless := flag.Bool("headless", false, "Enables headless mode for chromedp.")
6262

6363
// Parse flags
6464
flag.Parse()

parser/sectionParser.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ func getSectionNumber(classInfo map[string]string) string {
101101
}
102102

103103
func getTeachingAssistants(rowInfo map[string]*goquery.Selection) []schema.Assistant {
104-
assistantMatches := personRegexp.FindAllStringSubmatch(utils.TrimWhitespace(rowInfo["TA/RA(s):"].Text()), -1)
104+
taRow, ok := rowInfo["TA/RA(s):"]
105+
if !ok {
106+
return []schema.Assistant{}
107+
}
108+
assistantMatches := personRegexp.FindAllStringSubmatch(utils.TrimWhitespace(taRow.Text()), -1)
105109
assistants := make([]schema.Assistant, 0, len(assistantMatches))
106110

107111
for _, match := range assistantMatches {

0 commit comments

Comments
 (0)