wip new cfg params
This commit is contained in:
parent
44b25ed9d5
commit
2e8fa14df9
7 changed files with 141 additions and 49 deletions
|
@ -2,7 +2,6 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
@ -53,9 +52,7 @@ func PerformGoogleTextSearch(query, safe, lang string, page int) ([]TextSearchRe
|
|||
duration := time.Since(startTime) // Calculate the duration
|
||||
|
||||
if len(results) == 0 {
|
||||
if debugMode {
|
||||
log.Println("No results found from Google")
|
||||
}
|
||||
printDebug("No results found from Google Search")
|
||||
}
|
||||
|
||||
return results, duration, nil
|
||||
|
@ -83,9 +80,7 @@ func parseResults(doc *goquery.Document) []TextSearchResult {
|
|||
link := s.Find("a")
|
||||
href, exists := link.Attr("href")
|
||||
if !exists {
|
||||
if debugMode {
|
||||
log.Printf("No href attribute found for result %d\n", i)
|
||||
}
|
||||
printDebug("No href attribute found for result %d\n", i)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue