Ai
1 Star 1 Fork 0

灵狐/go-web-crawler

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Types.go 847 Bytes
一键复制 编辑 原始数据 按行查看 历史
灵狐 提交于 2025-05-10 20:30 +08:00 . 提交代码
package WebCrawler
import "github.com/PuerkitoBio/goquery"
type WebPage struct {
Host string
Url string
Head *WebHead
Hrefs map[string]*WebHref
Texts []*WebElement
Images []*WebElement
}
type WebHead struct {
Title string
Description string
Keywords []string
}
type WebHref struct {
Href string
Title string
}
type WebElement struct {
Tag string
Selection *goquery.Selection
Text string
}
func (e *WebElement) Clone() *WebElement {
clone := &WebElement{
Tag: e.Tag,
Selection: e.Selection,
Text: e.Text,
}
return clone
}
type Mode uint32
const (
ModeContain = Mode(1) // 包含:字符串
ModeEqual = Mode(2) // 相同:字符串
ModeRegexp = Mode(3) // 正则表达式
ModeElTag = Mode(4) // 元素的类型
)
type Filter struct {
Mode Mode
Param interface{}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/fierce_wolf/go-web-crawler.git
git@gitee.com:fierce_wolf/go-web-crawler.git
fierce_wolf
go-web-crawler
go-web-crawler
v1.0.1

搜索帮助