summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.go b/main.go
index 2d32a6d..920e9a5 100644
--- a/main.go
+++ b/main.go
@@ -88,11 +88,13 @@ func loadData() {
log.Println("Loading data.")
var code string
if blockTxt != "" {
- doc, err := htmlquery.LoadURL(listUrl)
- if err != nil {
+ if doc, err := htmlquery.LoadURL(listUrl); err != nil {
return
+ } else if found := htmlquery.FindOne(doc, blockTxt); found != nil {
+ return
+ } else {
+ code = htmlquery.InnerText(found)
}
- code = htmlquery.InnerText(htmlquery.FindOne(doc, blockTxt))
} else {
var dst []byte
_, byteCode, _ := fasthttp.Get(dst, string(listUrl))