From ac6642f64533a47807f37cd6b4572e374cb83f33 Mon Sep 17 00:00:00 2001 From: Yo'av Moshe Date: Thu, 12 Sep 2024 18:24:11 +0200 Subject: [PATCH] wrap table elements with a table because otherwise they disappear --- parsers/html.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parsers/html.go b/parsers/html.go index e46b6d6..d66a8ad 100644 --- a/parsers/html.go +++ b/parsers/html.go @@ -21,7 +21,7 @@ func ParseHTMLQueries(htmlData []byte, queries []string, nextPage string) (inter indentation := CalculateIndentation(line) if len(queries) > i+1 && CalculateIndentation(queries[i+1]) > indentation { // if line has children - elements := doc.Find(" " + line) + elements := doc.Find(line) // get new lines var lines []string @@ -39,6 +39,9 @@ func ParseHTMLQueries(htmlData []byte, queries []string, nextPage string) (inter elements.Each(func(subi int, subdoc *goquery.Selection) { html, _ := goquery.OuterHtml(subdoc) + if strings.HasPrefix(html, "" + } value2, _, _ := ParseHTMLQueries([]byte(html), lines, "") subresult = append(subresult, value2) })