Skip to content

Commit

Permalink
🔊 增加爬取错误输入日志
Browse files Browse the repository at this point in the history
  • Loading branch information
akkuman committed Jan 14, 2022
1 parent 84f1f1b commit 49c8c52
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,19 @@ func RunCrawler(fofaApiKey, fofaEmail, rule string, pageNum int) (err error) {
}

func StartRunCrawler(fofaApiKey, fofaEmail, rule string, pageCount int) {
go func() {
runCrawlerFunc := func() {
for i := 1; i <= 3; i++ {
RunCrawler(fofaApiKey, fofaEmail, rule, i)
err := RunCrawler(fofaApiKey, fofaEmail, rule, i)
if err != nil {
fmt.Printf("[!] error: %v\n", err)
}
}
}
go func() {
runCrawlerFunc()
ticker := time.NewTicker(600 * time.Second)
for range ticker.C {
for i := 1; i <= 3; i++ {
RunCrawler(fofaApiKey, fofaEmail, rule, i)
}
runCrawlerFunc()
}
}()
}

0 comments on commit 49c8c52

Please sign in to comment.