抓取的结果信息包含:
- 商品标题
- 商品价格
- 销量
- 地址
- 商品链接
- 评分
- 评论数
- 颜色
- 规格
- 库存
- 喜欢数
结果示例图:
模板:
{"_id":"xiapi-search-detail","startUrl":
["https://xiapi.xiapibuy.com/search?category=70&keyword=%E6%89%8B%E6%9C%BA&page=[0-4]"],"selectors":[{"id":"info","type":"SelectorElementScroll","parentSelectors":["_root"],"selector":"div.shopee-search-item-result__item","multiple":true,"delay":"2000"},{"id":"title","type":"SelectorText","parentSelectors":["info"],"selector":"div.O6wiAW","multiple":false,"regex":"","delay":0},{"id":"price","type":"SelectorText","parentSelectors":["info"],"selector":"div._2lBkmX","multiple":false,"regex":"","delay":0},{"id":"sells","type":"SelectorText","parentSelectors":["info"],"selector":"div._18SLBt","multiple":false,"regex":"","delay":0},{"id":"address","type":"SelectorText","parentSelectors":["info"],"selector":"div._3amru2","multiple":false,"regex":"","delay":0},{"id":"product-link","type":"SelectorLink","parentSelectors":["info"],"selector":"a","multiple":false,"delay":0},{"id":"score","type":"SelectorText","parentSelectors":["product-link","total"],"selector":"div._2z6cUg","multiple":false,"regex":"","delay":0},{"id":"reviews","type":"SelectorText","parentSelectors":["product-link","total"],"selector":"div.M3KjhJ:nth-of-type(2) div._3Oj5_n","multiple":false,"regex":"","delay":0},{"id":"color","type":"SelectorText","parentSelectors":["product-link","total"],"selector":"div.items-center:nth-of-type(1) div.crl7WW","multiple":false,"regex":"","delay":0},{"id":"style","type":"SelectorText","parentSelectors":["product-link","total"],"selector":"div.items-center:nth-of-type(2) div.crl7WW","multiple":false,"regex":"","delay":0},{"id":"avaliable","type":"SelectorText","parentSelectors":["product-link","total"],"selector":"._1FzU2Y .flex div:nth-of-type(2)","multiple":false,"regex":"\\d+","delay":0},{"id":"likes","type":"SelectorText","parentSelectors":["product-link","total"],"selector":"._25DJo1 div","multiple":false,"regex":"","delay":0},{"id":"total","type":"SelectorElement","parentSelectors":["product-link"],"selector":".page-product div.container","multiple":false,"delay":0}]}
模板套用步骤:
(1)进入需要抓取的商品搜索结果页面,例如:https://xiapi.xiapibuy.com/%E5%A5%B3%E7%94%9F%E8%A1%A3%E8%91%97-cat.62?page=0
(2)导入模板
(3)替换 Start URL为要抓取的网页链接,(抓取多页需修改 Start URL 里的页码数)
(4)开始抓取
小提示:
这个模板抓取的信息更全面,但是需要进入每个商品的详情页,所以需要的抓取时间也更多一些。