{"id":30930272,"url":"https://github.com/peteryangs/yyspider","last_synced_at":"2026-05-27T13:38:06.622Z","repository":{"id":215248929,"uuid":"738467460","full_name":"PeterYangs/yySpider","owner":"PeterYangs","description":"简单的网页选择器采集工具","archived":false,"fork":false,"pushed_at":"2026-03-30T06:57:18.000Z","size":179,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-27T13:38:00.273Z","etag":null,"topics":["go","golang","scraper","spider"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PeterYangs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-03T09:46:44.000Z","updated_at":"2026-03-30T07:11:35.000Z","dependencies_parsed_at":"2024-01-03T11:32:04.592Z","dependency_job_id":"a6a3d953-87d7-4ff5-bbc2-9023e10e4ae2","html_url":"https://github.com/PeterYangs/yySpider","commit_stats":null,"previous_names":["peteryangs/yyspider"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/PeterYangs/yySpider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterYangs%2FyySpider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterYangs%2FyySpider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterYangs%2FyySpider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterYangs%2FyySpider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterYangs","download_url":"https://codeload.github.com/PeterYangs/yySpider/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterYangs%2FyySpider/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33568857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","scraper","spider"],"created_at":"2025-09-10T10:44:04.281Z","updated_at":"2026-05-27T13:38:06.615Z","avatar_url":"https://github.com/PeterYangs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"### YySpider是一个简单的采集工具\n\u003chr/\u003e\n\n声明：该爬虫仅供学习使用，如产生任何法律后果，本人概不负责\n\n**安装**\n\n```shell\ngo get github.com/PeterYangs/yySpider\n```\n\n\n**文档**\n\n[中文文档](https://github.com/PeterYangs/yySpider/blob/master/QuickStart.md)\n[English](https://github.com/PeterYangs/yySpider/blob/master/QuickStart_en.md)\n\n**快速开始**\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/PeterYangs/yySpider\"\n\tuuid \"github.com/satori/go.uuid\"\n\t\"context\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\ts := yySpider.NewYySpider(context.Background())\n\n\t//设置域名\n\ts.Host(\"https://www.secretmine.net\")\n\n\t//打开debug\n\ts.Debug()\n\n\t//第一个页面是列表\n\tlist := s.NewListPage(\n\t\t\"/tag/page_[PAGE]/\", //列表规则,页码用[PAGE]代替\n\t\t\"body \u003e div.main \u003e div.downlist.boxbg.lazy.clearfix \u003e ul \u003e li\", //列表选择器\n\t\t1, //起始页码\n\t\t2, //采集长度\n\t)\n\n\t//列表采集\n\tlist.SetFields(map[string]yySpider.Field{\n\t\t\"title\": {Type: yySpider.Text, Selector: \" div \u003e b \u003e a\"}, //采集列表的标题，选择器是相对列表，比如列表选择器是ul li,这里的选择器就是从li开始找\n\t\t\"size\": {Type: yySpider.Text, Selector: \" div \u003e i:nth-child(3)\", ConversionFunc: func(item string) string {\n\t\t\treturn strings.Replace(item, \"大小：\", \"\", -1)\n\t\t}}, //ConversionFunc是转换器，item是采集到的结果，返回你需要的格式\n\t})\n\n\t//设置详情页page的入口，这里的意思是，列表上的li下的 p \u003e a的a链接是详情页，取href属性\n\tlist.SetNextPageLinkSelector(\" p \u003e a\", \"href\")\n\n\t//实例化详情页面\n\tdetail := s.NewDetailPage()\n\n\t//跟列表配置一样\n\tdetail.SetFields(map[string]yySpider.Field{\n\t\t\"img\": {Type: yySpider.Image, Selector: \"body \u003e div.comment_box.clearfix \u003e div.down_infor_top \u003e div \u003e img\"},\n\t})\n\n\t//设置输出的xlsx文件路径\n\ts.SetXlsxName(\"xlsx/\" + uuid.NewV4().String())\n\n\terr := s.Start()\n\n\tif err != nil {\n\n\t\tfmt.Println(err)\n\n\t}\n\n}\n```\n\n**多页面采集**\n\u003cbr/\u003e\n采集小说这种的多级页面\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/PeterYangs/yySpider\"\n\t\"context\"\n)\n\nfunc main() {\n\n\ts := yySpider.NewYySpider(context.Background())\n\n\t//设置域名\n\ts.Host(\"https://www.yznnw.com\")\n\n\t//设置headers\n\ts.Headers(map[string]string{\n\t\t\"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36\",\n\t})\n\n\t//打开debug\n\ts.Debug()\n\n\t//第一个页面是小说列表页\n\tlist := s.NewListPage(\n\t\t\"/list/1/1.html\",\n\t\t\"ul.list_l2 \u003e li\",\n\t\t1,\n\t\t1,\n\t)\n\n\t//设置选择器\n\tlist.SetFields(map[string]yySpider.Field{\n\t\t\"title\": {Type: yySpider.Text, Selector: \"a\"},\n\t})\n\n\t//设置下一个page入口\n\tlist.SetNextPageLinkSelector(\"a\", \"href\")\n\n\t//小说章节列表页面\n\tlist2 := s.NewListPage(\n\t\t\"\",\n\t\t\".section-list li\",\n\t\t1,\n\t\t1,\n\t)\n\n\t//设置选择器\n\tlist2.SetFields(map[string]yySpider.Field{\n\t\t\"zhang_name\": {Type: yySpider.Text, Selector: \"a\"},\n\t})\n\n\t//设置下一个page入口\n\tlist2.SetNextPageLinkSelector(\"a\", \"href\")\n\n\t//详情页\n\tdetail := s.NewDetailPage()\n\n\tdetail.SetFields(map[string]yySpider.Field{\n\t\t\"detail_title\": {Type: yySpider.Text, Selector: \".chapter-title\"},\n\t})\n\n\terr := s.Start()\n\n\tif err != nil {\n\n\t\tfmt.Println(err)\n\n\t}\n\n}\n```\n\n**自定义采集结果**\n\u003cbr/\u003e\n结果不会生成到xlsx\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/PeterYangs/yySpider\"\n\t\"context\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\ts := yySpider.NewYySpider(context.Background())\n\n\t//设置域名\n\ts.Host(\"https://www.secretmine.net\")\n\n\t//打开debug\n\t//s.Debug()\n\n\t//第一个页面是列表\n\tlist := s.NewListPage(\n\t\t\"/tag/page_[PAGE]/\", //列表规则,页码用[PAGE]代替\n\t\t\"body \u003e div.main \u003e div.downlist.boxbg.lazy.clearfix \u003e ul \u003e li\", //列表选择器\n\t\t1, //起始页码\n\t\t2, //采集长度\n\t)\n\n\t//列表采集\n\tlist.SetFields(map[string]yySpider.Field{\n\t\t\"title\": {Type: yySpider.Text, Selector: \" div \u003e b \u003e a\"}, //采集列表的标题，选择器是相对列表，比如列表选择器是ul li,这里的选择器就是从li开始找\n\t\t\"size\": {Type: yySpider.Text, Selector: \" div \u003e i:nth-child(3)\", ConversionFunc: func(item string) string {\n\t\t\treturn strings.Replace(item, \"大小：\", \"\", -1)\n\t\t}}, //ConversionFunc是转换器，item是采集到的结果，返回你需要的格式\n\t})\n\n\t//设置详情页的入口，这里的意思是，列表上的li下的 p \u003e a的a链接是详情页，取href属性\n\tlist.SetNextPageLinkSelector(\" p \u003e a\", \"href\")\n\n\t//实例化详情页面\n\tdetail := s.NewDetailPage()\n\n\t//跟列表配置一样\n\tdetail.SetFields(map[string]yySpider.Field{\n\t\t\"img\": {Type: yySpider.Image, Selector: \"body \u003e div.comment_box.clearfix \u003e div.down_infor_top \u003e div \u003e img\"},\n\t})\n\n\t//自行处理采集结果\n\ts.ResultCallback(func(item map[string]string) {\n\n\t\tfmt.Println(item)\n\n\t})\n\n\terr := s.Start()\n\n\tif err != nil {\n\n\t\tfmt.Println(err)\n\n\t}\n\n}\n```\n\n**数据过滤**\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/PeterYangs/yySpider\"\n\tuuid \"github.com/satori/go.uuid\"\n\t\"context\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\ts := yySpider.NewYySpider(context.Background())\n\n\t//设置域名\n\ts.Host(\"https://www.secretmine.net\")\n\n\t//打开debug\n\ts.Debug()\n\n\t//第一个页面是列表\n\tlist := s.NewListPage(\n\t\t\"/tag/page_[PAGE]/\", //列表规则,页码用[PAGE]代替\n\t\t\"body \u003e div.main \u003e div.downlist.boxbg.lazy.clearfix \u003e ul \u003e li\", //列表选择器\n\t\t1, //起始页码\n\t\t1, //采集长度\n\t)\n\n\t//列表采集\n\tlist.SetFields(map[string]yySpider.Field{\n\t\t\"title\": {Type: yySpider.Text, Selector: \" div \u003e b \u003e a\"}, //采集列表的标题，选择器是相对列表，比如列表选择器是ul li,这里的选择器就是从li开始找\n\t\t\"size\": {Type: yySpider.Text, Selector: \" div \u003e i:nth-child(3)\", ConversionFunc: func(item string) string {\n\t\t\treturn strings.Replace(item, \"大小：\", \"\", -1)\n\t\t}}, //ConversionFunc是转换器，item是采集到的结果，返回你需要的格式\n\t}).CallbackWithBreak(func(item map[string]string) bool {\n\t\t//数据过滤\n\t\tif item[\"title\"] != \"pvz2杂交版2.3版本\" {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t})\n\n\t//设置详情页的入口，这里的意思是，列表上的li下的 p \u003e a的a链接是详情页，取href属性\n\tlist.SetNextPageLinkSelector(\" p \u003e a\", \"href\")\n\n\t//实例化详情页面\n\tdetail := s.NewDetailPage()\n\n\t//跟列表配置一样\n\tdetail.SetFields(map[string]yySpider.Field{\n\t\t\"source\": {Type: yySpider.Text, Selector: \" #decimal_unm\"},\n\t}).CallbackWithBreak(func(item map[string]string) bool {\n\t\t//数据过滤\n\t\tif item[\"source\"] != \"8.5\" {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t})\n\n\t//设置输出的xlsx文件路径\n\ts.SetXlsxName(\"xlsx/\" + uuid.NewV4().String())\n\n\terr := s.Start()\n\n\tif err != nil {\n\n\t\tfmt.Println(err)\n\n\t}\n\n}\n```\n\n**列表抓取前回调**\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/PeterYangs/yySpider\"\n\t\"context\"\n)\n\nfunc main() {\n\n\t//cxt, cancel := context.WithCancel(context.Background())\n\n\t//每个page需要一个入口\n\t//cancel()\n\t//_ = cancel\n\ts := yySpider.NewYySpider(context.Background())\n\n\ts.Host(\"https://www.925g.com\")\n\n\ts.Debug()\n\n\tlist := s.NewListPage(\n\t\t\"/gonglue/list_[PAGE].html\",\n\t\t\"#ctbar-ctbarw \u003e div.uk-background-default \u003e div \u003e div \u003e div \u003e div.commonLeftDiv.uk-float-left \u003e div \u003e div.bdDiv \u003e div \u003e ul \u003e li\",\n\t\t1,\n\t\t1,\n\t)\n\n\tlist.SetFields(map[string]yySpider.Field{\n\t\t\"title\": {Type: yySpider.Text, Selector: \"a \u003e div \u003e span\"},\n\t})\n\n\t//列表上每个结果回调\n\tlist.Callback(func(item map[string]string) {\n\n\t\tfmt.Println(item)\n\t})\n\n\t//列表抓取前回调\n\tlist.RequestListPrefixCallback(func(listUrl string, currentIndex int) {\n\n\t})\n\n\tlist.SetNextPageLinkSelector(\"a\", \"href\")\n\n\tdetail := s.NewDetailPage()\n\n\tdetail.SetFields(map[string]yySpider.Field{\n\t\t\"title2\": {Type: yySpider.Text, Selector: \"h1\"},\n\t})\n\n\terr := s.Start()\n\n\tif err != nil {\n\n\t\tfmt.Println(err)\n\n\t}\n\n}\n```\n\n**多个list page带分页的**\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/PeterYangs/yySpider\"\n\t\"context\"\n\t\"time\"\n)\n\nfunc main() {\n\n\ts := yySpider.NewYySpider(context.Background())\n\n\t//设置代理\n\ts.SetProxy(\"http://127.0.0.1:7897\")\n\n\t//设置域名\n\ts.Host(\"https://slickdeals.net\")\n\n\t//设置headers\n\ts.Headers(map[string]string{\n\t\t\"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36\",\n\t})\n\n\t//打开debug\n\ts.Debug()\n\n\t//第一个页面是商品分类列表\n\tlist := s.NewListPage(\n\t\t\"/deal-categories/\",\n\t\t\".featured-deals \u003e li\",\n\t\t1,\n\t\t1,\n\t)\n\n\t//设置选择器\n\tlist.SetFields(map[string]yySpider.Field{\n\t\t\"category_name\": {Type: yySpider.Text, Selector: \"a\"},\n\t})\n\n\t////设置下一个page的入口\n\tlist.SetNextPageLinkSelector(\"a\", \"href\")\n\n\t//商品列表页\n\tlist2 := s.NewListPage(\n\t\t\"\",\n\t\t\".bp-p-filterGrid_items li.bp-c-card\",\n\t\t1,\n\t\t1,\n\t)\n\n\t//设置选择器\n\tlist2.SetFields(map[string]yySpider.Field{\n\t\t//\"title\": {Type: yySpider.Text, Selector: \".bp-c-card_title\"},\n\t})\n\n\tlist2.Callback(func(item map[string]string) {\n\n\t\ttime.Sleep(200 * time.Millisecond)\n\n\t})\n\n\t//下一页链接(/category_name/?page=1)\n\tlist2.SetPreviousLinkCallback(func(listUrl string) string {\n\n\t\treturn listUrl + \"?page=[PAGE]\"\n\t}, 1, 12)\n\n\t//下一个Page选择器\n\tlist2.SetNextPageLinkSelector(\"a.bp-c-link\", \"href\")\n\n\tdetail := s.NewDetailPage()\n\n\tdetail.SetFields(map[string]yySpider.Field{\n\t\t\"title\":          {Type: yySpider.Text, Selector: \"h1.dealDetailsMainBlock__dealTitle\"},\n\t\t\"original_price\": {Type: yySpider.Text, Selector: \"h3.dealDetailsMainBlock__listPrice\"},\n\t\t\"price\":          {Type: yySpider.Text, Selector: \"h2.dealDetailsMainBlock__finalPrice\"},\n\t\t\"screenshots\":    {Type: yySpider.Attrs, Selector: \".dealDetailsMainBlock__dealImageGalleryContainer .carousel__viewport \u003e .carousel__track img\", AttrKey: \"src\"},\n\t\t\"content\":        {Type: yySpider.OnlyHtml, Selector: \".dealDetailsRawHtml\"},\n\t\t\"store_link\": {Type: yySpider.Attr, Selector: \".dealDetailsOutclickButton\", AttrKey: \"href\", ConversionFunc: func(item string) string {\n\n\t\t\tsss, err := s.GetRedirectUrl(item)\n\n\t\t\tif err != nil {\n\n\t\t\t\tfmt.Println(err)\n\t\t\t}\n\n\t\t\treturn sss\n\t\t}},\n\t})\n\n\tdetail.Callback(func(item map[string]string) {\n\n\t\ttime.Sleep(100 * time.Millisecond)\n\t})\n\n\ts.ResultCallback(func(item map[string]string) {\n\n\t\tfmt.Println(item[\"store_link\"])\n\n\t})\n\n\terr := s.Start()\n\n\tif err != nil {\n\n\t\tfmt.Println(err)\n\n\t}\n\n}\n\n```\n\n**无头浏览器模式**\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/PeterYangs/yySpider\"\n\t\"github.com/chromedp/chromedp\"\n\t\"context\"\n\t\"time\"\n)\n\nfunc main() {\n\n\ts := yySpider.NewYySpider(context.Background())\n\n\t//无头浏览器模式\n\ts.UseBrowserMode()\n\n\t//设置域名\n\ts.Host(\"https://www.289.com\")\n\n\t//打开debug（无头浏览器模式下会打开网页）\n\ts.Debug()\n\n\t//列表\n\tlist := s.NewListPage(\n\t\t\"/azrj/list-161-[PAGE].html\",\n\t\t\".m-downlistul li\",\n\t\t1,\n\t\t1,\n\t)\n\n\t//等待元素出现（只在无头浏览器模式下生效）\n\tlist.SetWaitElement(\".m-downlistul\", 30*time.Second)\n\n\t//设置选择器\n\tlist.SetFields(map[string]yySpider.Field{\n\t\t\"title\": {Type: yySpider.Text, Selector: \".m-tit\"}, //分类名称\n\t})\n\n\t//设置下一个page的入口\n\tlist.SetNextPageLinkSelector(\"p.m-tit \u003e a\", \"href\")\n\n\tdetail := s.NewDetailPage()\n\n\tdetail.SetFields(map[string]yySpider.Field{\n\t\t\"download_url\": {Type: yySpider.Attr, Selector: \".address_like \u003e a\", AttrKey: \"href\"},\n\t})\n\n\t//等待元素出现（只在无头浏览器模式下生效）\n\tdetail.SetWaitElement(\".m-goabtn\", 10*time.Second)\n\n\t//获取html前操作浏览器（只在无头浏览器模式下生效）\n\tdetail.SetChromedpBeforeCallback(func(ctx context.Context, htmlUrl string) error {\n\n\t\terr := chromedp.Click(\".m-goabtn\", chromedp.ByQuery).Do(ctx)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tctx2, _ := context.WithTimeout(ctx, 5*time.Second)\n\n\t\treturn chromedp.WaitVisible(\".address_like\", chromedp.ByQuery).Do(ctx2)\n\n\t})\n\n\tdetail.SetHtmlCallback(func(htmlStr string, httpCode int, url string) {\n\n\t\ttime.Sleep(800 * time.Millisecond)\n\t})\n\n\ts.ResultCallback(func(item map[string]string) {\n\n\t\tfmt.Println(item)\n\n\t})\n\n\terr := s.Start()\n\n\tif err != nil {\n\n\t\tfmt.Println(err)\n\n\t}\n\n}\n\n```\n\n**捕获下载链接**\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/PeterYangs/yySpider\"\n\t\"github.com/chromedp/chromedp\"\n\t\"context\"\n\t\"time\"\n)\n\nfunc main() {\n\n\ts := yySpider.NewYySpider(context.Background())\n\n\t//无头浏览器模式\n\ts.UseBrowserMode()\n\n\ts.SetDeviceType(yySpider.DeviceAndroid)\n\n\t//设置域名\n\ts.Host(\"https://m.cssmoban.com\")\n\n\t//打开debug（无头浏览器模式下会打开网页）\n\ts.Debug()\n\n\t//列表\n\tlist := s.NewListPage(\n\t\t\"/app/\",\n\t\t\".app_soft_bd li\",\n\t\t1,\n\t\t1,\n\t)\n\n\t//等待元素出现（只在无头浏览器模式下生效）\n\tlist.SetWaitElement(\"#app_hot_list_view\", 30*time.Second)\n\n\t//设置选择器\n\tlist.SetFields(map[string]yySpider.Field{\n\t\t\"title\": {Type: yySpider.Text, Selector: \"h3\"}, //分类名称\n\t})\n\n\t//设置下一个page的入口\n\tlist.SetNextPageLinkSelector(\"a\", \"href\")\n\n\tdetail := s.NewDetailPage()\n\n\tdetail.SetFields(map[string]yySpider.Field{\n\t\t//\"download_url\": {Type: yySpider.Attr, Selector: \".address_like \u003e a\", AttrKey: \"href\"},\n\t\t\"title2\": {Type: yySpider.Text, Selector: \"h1\"}, //分类名称\n\t})\n\n\t//等待元素出现（只在无头浏览器模式下生效）\n\tdetail.SetWaitElement(\"h1\", 10*time.Second)\n\n\t//捕获下载链接（结果会出现在结果中）\n\tdetail.SetDownload(\"download_url\")\n\n\t//获取html前操作浏览器（只在无头浏览器模式下生效）\n\tdetail.SetChromedpBeforeCallback(func(ctx context.Context, htmlUrl string) error {\n\n\t\tctx2, _ := context.WithTimeout(ctx, 5*time.Second)\n\n\t\teee := chromedp.WaitVisible(\"#downlinkaddress\", chromedp.ByQuery).Do(ctx2)\n\n\t\tif eee != nil {\n\n\t\t\tfmt.Println(eee)\n\n\t\t\treturn eee\n\t\t}\n\n\t\ttime.Sleep(3 * time.Second)\n\n\t\terr := chromedp.Click(\"#downlinkaddress\", chromedp.ByQuery).Do(ctx)\n\n\t\tif err != nil {\n\n\t\t\tfmt.Println(err)\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t})\n\n\tdetail.SetHtmlCallback(func(htmlStr string, httpCode int, url string) {\n\n\t})\n\n\ts.ResultCallback(func(item map[string]string) {\n\t\ttime.Sleep(1200 * time.Millisecond)\n\t\tfmt.Println(item)\n\n\t})\n\n\terr := s.Start()\n\n\tif err != nil {\n\n\t\tfmt.Println(err)\n\n\t}\n\n}\n\n```\n\n**字段类型**\n```go\n\"title\":         {Type: yySpider.Text, Selector: \" div \u003e b \u003e a\"},               //文本\n\"img\":           {Type: yySpider.Image, Selector: \" div \u003e img\"},                //单张图片\n\"imgs\":          {Type: yySpider.MultipleImages, Selector: \"div \u003e img\"},        //多张图片\n\"html\":          {Type: yySpider.OnlyHtml, Selector: \".content\"},               //富文本\n\"HtmlWithImage\": {Type: yySpider.HtmlWithImage, Selector: \".content\"},          //富文本带图片\n\"attr\":          {Type: yySpider.Attr, Selector: \".content\", AttrKey: \"href\"},  //元素属性\n\"attrs\":         {Type: yySpider.Attrs, Selector: \".content\", AttrKey: \"href\"}, //属性列表，如一个图片列表的所有图片链接\n\"fixed\":         {Type: yySpider.Fixed, Selector: \"固定内容\"},                      //固定内容，Selector填什么就输出什么\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeteryangs%2Fyyspider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeteryangs%2Fyyspider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeteryangs%2Fyyspider/lists"}