Skip to content

Commit

Permalink
🐛 fix: Anquanke Crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
Le0nsec committed Dec 21, 2021
1 parent 9fc3428 commit 44ac2ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ func getAnquanke() ([][]string, error) {
re, _ = regexp.Compile(`\s{2,}`)
bodyString = re.ReplaceAllString(bodyString, "")

//去除href中可能存在的class
re, _ = regexp.Compile(`class="red-title"`)
bodyString = re.ReplaceAllString(bodyString, "")

re = regexp.MustCompile(`<div class="title"><a target="_blank" rel="noopener noreferrer"href="(.*?)"> (.*?)</a></div></i>(.*?)</span>`)
result := re.FindAllStringSubmatch(strings.TrimSpace(bodyString), -1)

Expand Down

0 comments on commit 44ac2ef

Please sign in to comment.