diff --git a/goSpider.go b/goSpider.go index 1fc123d..bd9a841 100644 --- a/goSpider.go +++ b/goSpider.go @@ -1127,7 +1127,8 @@ func calculateDateDifference(startDate, endDate time.Time) (int, int, int) { return years, months, days } -func PrintHtml(pageSource *html.Node) (string, error) { +// ParseHtmlToString used for parsing html.node into string for debugging purposes +func ParseHtmlToString(pageSource *html.Node) (string, error) { var sb strings.Builder err := html.Render(&sb, pageSource) if err != nil { diff --git a/goSpider_test.go b/goSpider_test.go index c45fca8..35b80a9 100644 --- a/goSpider_test.go +++ b/goSpider_test.go @@ -622,9 +622,9 @@ func TestPrintHtml(t *testing.T) { t.Errorf("GetPageSource error: %v", err) } - s, err := PrintHtml(ps) + s, err := ParseHtmlToString(ps) if err != nil { - t.Errorf("PrintHtml error: %v", err) + t.Errorf("ParseHtmlToString error: %v", err) } fmt.Println(s)