@my943813636
2019-01-28T08:53:41.000000Z
字数 15326
阅读 1108
搜图接口返回
offerList[]
价格 : tradePrice.offerPrice 下面的 caigouPriceYuan + caigouPriceFen 拼接
标题: information.subject
主图: image.imgUrlOf220x220
选择器
"div[data-layout-widget-name='wap_detail_common_image'] .detail-image-layer-container > .swipe-pane > img"
样式
<img src="https://img.alicdn.com/tfs/TB19MtAqb2pK1RjSZFsXXaNlXXa-800-802.png"swipe-lazy-src="https://cbu01.alicdn.com/img/ibank/2018/320/792/9692297023_552744963.640x640.jpg"class="swipe-image">
这是一个列表 有多个图片 使用swipe-lazy-src 属性
路径
"div[data-layout-widget-name='wap_detail_common_title'] .title-content > .title-text"
样式
<span class="title-text">i9s蓝牙耳机新款 入耳式运动耳机带充电仓 i7s tws无线蓝牙耳机</span>
使用 text 属性
路径
"div[data-layout-widget-name='wap_detail_common_price'] .module-wap-detail-common-price > script"
使用innerHTML属性
{"discount": "0.99","showPriceRanges": [{"convertPrice": "8.91-62.37", //优惠价"price": "9.00-63.00", //原价"range": "1"}],"beginAmount": "1", //最低购买量"promotionBeginAmount": "1" //最低优惠购买量}
路径
"div[data-layout-widget-name='wap_detail_common_tradedata'] .detail-tradedata-data-areas input:nth-of-type(1)"
样式
<input type="hidden" data-tradedata-area-index="1" data-tradedata-1st-name="近30天成交"data-tradedata-1st-value="912" data-tradedata-2nd-name="复购率"data-tradedata-2nd-value="30.43%" data-tradedata-2nd-unit="%"/>
30 天成交量 data-tradedata-1st-value 属性
复购率 data-tradedata-2nd-value 属性
获取评论接口 (参数加密和淘宝一样(猜测 因为appkey 一样, 需要到 cookie))
GET https://h5api.m.1688.com/h5/com.alibaba.shared.rate.service.rate.mtoprateservice.queryofferratelist/1.0/?appKey=12574478&t=1548657591213&sign=341ee776f19c1c2c3574c79a655bc194&data=%7B%22itemId%22%3A%22570948906315%22%2C%22receiveUserId%22%3A%222862291253%22%2C%22haveContent%22%3A1%2C%22page%22%3A1%2C%22pageSize%22%3A15%2C%22isNeedInitRate%22%3Afalse%7D HTTP/1.1
接口返回
{"api": "com.alibaba.shared.rate.service.rate.mtoprateservice.queryofferratelist","data": {"headers": {},"httpStatusCode": "200","model": {"commentList": [{"content": "质量很好,满意","gmtCreate": "2018-07-23 09:35:05","gmtPublished": "2018-07-23 09:35:05","id": "1844911697","isNym": "false","isSystemRemark": "false","isTaobaoMember": "0","quantity": "60.0","ratedUserNick": "深**技","raterUserNick": "冷**5","specInfo": "颜色#3BI7S迷你款过UV黑色#7C颜色#3BI8蓝牙耳机#7C颜色#3BI7S迷你款过UV白色","starLevel": "5","status": "PUBLISHED","unit": "条"},{"content": "一般吧,不怎么好,有点拿货贵了。","gmtCreate": "2018-07-19 18:59:41","gmtPublished": "2018-07-19 18:59:40","id": "1768488742","isNym": "false","isSystemRemark": "false","isTaobaoMember": "0","quantity": "1.0","ratedUserNick": "深**技","raterUserNick": "丁**2","specInfo": "颜色#3BI7S标准版(6904F芯片)白色","starLevel": "4","status": "PUBLISHED","unit": "条"}],"totalNum": "181", //这个就评论总数"contentNum": "35" //这个是带内容的评论总数}},"ret": ["SUCCESS::调用成功"],"v": "1.0"}
获取评论接口 (参数加密和淘宝一样(猜测 因为appkey 一样, 需要到 cookie))
GET https://h5api.m.1688.com/h5/com.alibaba.shared.rate.service.rate.mtoprateservice.queryofferratelist/1.0/?appKey=12574478&t=1548657591213&sign=341ee776f19c1c2c3574c79a655bc194&data=%7B%22itemId%22%3A%22570948906315%22%2C%22receiveUserId%22%3A%222862291253%22%2C%22haveContent%22%3A1%2C%22page%22%3A1%2C%22pageSize%22%3A15%2C%22isNeedInitRate%22%3Afalse%7D HTTP/1.1
接口返回
{"api": "com.alibaba.shared.rate.service.rate.mtoprateservice.queryofferratelist","data": {"headers": {},"httpStatusCode": "200","model": {"commentList": [{"content": "质量很好,满意","gmtCreate": "2018-07-23 09:35:05","gmtPublished": "2018-07-23 09:35:05","id": "1844911697","isNym": "false","isSystemRemark": "false","isTaobaoMember": "0","quantity": "60.0","ratedUserNick": "深**技","raterUserNick": "冷**5","specInfo": "颜色#3BI7S迷你款过UV黑色#7C颜色#3BI8蓝牙耳机#7C颜色#3BI7S迷你款过UV白色","starLevel": "5","status": "PUBLISHED","unit": "条"},{"content": "一般吧,不怎么好,有点拿货贵了。","gmtCreate": "2018-07-19 18:59:41","gmtPublished": "2018-07-19 18:59:40","id": "1768488742","isNym": "false","isSystemRemark": "false","isTaobaoMember": "0","quantity": "1.0","ratedUserNick": "深**技","raterUserNick": "丁**2","specInfo": "颜色#3BI7S标准版(6904F芯片)白色","starLevel": "4","status": "PUBLISHED","unit": "条"}],"totalNum": "181", //这个就评论总数"contentNum": "35" //这个是带内容的评论总数}},"ret": ["SUCCESS::调用成功"],"v": "1.0"}
"div[data-layout-widget-name='wap_detail_common_footer'] #widget-wap-detail-common-footer script"
使用innerHTML属性
{"payAmount": "83","countdown": "0","installmentOffer": "false","isConsignMarketOffer": "true","isCybMicroSupply": "true","isEMallOffer": "","isPreheatOffer": "false","channelStockAmount": "","requestSK": "","sellerLoginId": "深圳润至科技","sellerMemberId": "b2b-28622912538108a","sellerUserId": "2862291253","isBuyerLogin": "false","token": "f438c862922eb774bd4bfcd19b745344","skuProps": [{"prop": "颜色","value": [{"imageUrl": "https://cbu01.alicdn.com/img/ibank/2018/832/492/9692294238_552744963.jpg","name": "I7单耳-黑色"}]}],"skuMap": {"i7s真立体粉色": {"canBookCount": 570948,"discountPrice": "27.72","discountStandardPrice": "","price": "28.00","retailPrice": "199.00","saleCount": 6,"skuId": 3902434424952,"specId": "662b988b308abc1ee99b8df2ce3d5d39","standardPrice": "","storageInfos": []},"i7s真立体金色": {"canBookCount": 570879,"discountPrice": "27.72","discountStandardPrice": "","price": "28.00","retailPrice": "199.00","saleCount": 9,"skuId": 3902434424953,"specId": "eb57d168ca85eceb78dcc254c4363b0e","standardPrice": "","storageInfos": []}},"previewImageUrl": "https://cbu01.alicdn.com/img/ibank/2018/994/969/9396969499_552744963.jpg","offerId": "570948906315","offerSubject": "i9s蓝牙耳机新款 入耳式运动耳机带充电仓 i7s tws无线蓝牙耳机","showPromotionDiscount": "true","beginAmount": "1","totalCanBookCount": "13746435","isSupportMix": "false","hasConsignPrice": "false","hasConsignReation": "false","mixAmount": "100","mixNumber": "1","mixBegin": "","unit": "条","sellScale": "","sellUnit": "","promotionLimitCount": "-1","personLimitCount": "-1","isOfferSupportOnlineTrade": "true","isOfferDetailShielding": "false","isHottiming": "false","isRunning": "true","pageScene": "dsc","displayPrice": "9.00-63.00","promotionDisplayPrice": "8.91-62.37","flow": "general","activityBtnCartBackgroundColor": "","activityBtnCartBackgroundImage": "","visitorPicAuth": "open","visitorPriceAuth": "open","buttonTextOfCannotTrade": "","textOfCannotTrade": ""}
路径
"div[data-layout-widget-name='wap_detail_common_attribute'] .takla-item-text""
<span class="detail-attribute-item" data-offer-attribute-item="Y"data-offer-attribute-name="品牌" data-offer-attribute-value="润至">
这个是一个列表 取data-offer-attribute-name 和 data-offer-attribute-value 作为参数
路径
"div[data-widget-build-name='widget_wap_detail_common_description'] #widget-wap-detail-common-description script"
使用innerHTML属性 样式
{"detailTemplateInfo": [{"contentUrl": "https://img.alicdn.com/tfscom/TB1oKl0AXYqK1RjSZLeXXbXppXa","id": "0","title": "图文详情"}],"detailUrl": "https://img.alicdn.com/tfscom/TB1oUJ4AgHqK1RjSZFPXXcwapXa"}
然后再请求 detailUrl 内容
获得
var offer_details={"content":"<div id=\"offer-template-0\"></div><p style=\"text-align: center;\"><span style=\"font-size: 26.0pt;\">深圳市润至科技有限公司</span></p><p> </p><p><span style=\"font-size: 16.0pt;\">自有工厂,源头厂家,物美价优,品质保证!常备现货库存,随时出货!专业为跨境电商:<span style=\"color: #ff0000;\">亚马逊、eBay、速卖通、敦煌网</span>;和国内电商:<span style=\"color: #ff0000;\">淘宝天猫网店、京东网店,微商,<span style=\"color: #000000;\">以及</span>实体店主,批发商</span>等客户提供优质的一手货源。</span></p><p> </p><p><span style=\"font-size: 16.0pt;\">我司可以按照客户的要求<span style=\"color: #ff0000;\">订制LOGO</span>;可提供中性包装;<span style=\"color: #ff0000;\">承接广大客户OEM/ODM订单。</span></span></p><p><span style=\"font-size: 16.0pt;\"> </span></p><p><span style=\"font-size: 16.0pt;\">备注:全部包含纸盒包装(含充电线、说明书、高档纸盒包装)。</span></p><p><span style=\"font-size: 16.0pt;\">如需采购大量的话,细节可以洽谈。本公司出货的蓝牙耳机音质、外观和包装都是高品质的,质量相对于现市面上的货很大的优势,新客户可以拿样体验。</span></p><p> </p><p><span style=\"color: #ff0000;font-size: 22.0pt;\"><span style=\"font-size: xx-large;\">王先生VX/TEL:17722677515</span></span></p><p><span style=\"font-size: 22.0pt;\">地址:</span><span style=\"font-size: 22.0pt;\">深圳市宝安区西乡固戍勤辉路6号A栋3楼。</span></p><p><span style=\"line-height: 44.0px;font-size: 29.33px;\">欢迎来我们工厂拿货看样</span></p><p> </p><p><span> </span></p><p><span style=\"font-size: 18.0pt;\">i7对耳无线蓝牙耳机(V4.2蓝牙芯片)。</span></p><p><span style=\"font-size: 18.0pt;\">产品功能:听音乐,接听电话</span></p><p><span style=\"font-size: 18.0pt;\">蓝牙版本: 4.2版本<br />传输距离:室外直线距离10-18 米<br />电池容量:聚合物锂电池 45mah </span></p><p><span style=\"font-size: 18.0pt;\">充电盒电池容量:400mah </span></p><p><span style=\"font-size: 22.0pt;\"><span style=\"font-size: 18.0pt;\">听音乐时间:2.5小时 上下曲/暂停播放</span><br /><span style=\"font-size: 18.0pt;\">通话时间:2 小时</span><br /><span style=\"font-size: 18.0pt;\">待机时间:130 小时</span><br /><span style=\"font-size: 18.0pt;\">充电时间:1-2小时</span><br /><span style=\"font-size: 18.0pt;\">工作电流:22MA</span><br /><span style=\"font-size: 18.0pt;\">待机电流:4uA</span><br /><span style=\"font-size: 18.0pt;\">-Bluetooth class---蓝牙级别: class2和class3</span><br /><span style=\"font-size: 18.0pt;\">-frequency band---频带/频段 : 2.4—2.485GHz</span><br /><span style=\"font-size: 18.0pt;\">-modulation process---调制过程 : GFSK</span><br /><span style=\"font-size: 18.0pt;\">-max. transmitter power---最大发射功率: +2DBm</span><br /><span style=\"font-size: 18.0pt;\">配对方式:长按开机蓝灯快闪是普通配对模式,开机后不松开继续按三秒到蓝灯快速闪烁,此时提示音paring,然后进入 双耳配对状态。双耳配对成功后蓝灯慢闪。</span><br /><span style=\"font-size: 18.0pt;\">提示音:开机提示:POWER ON</span><br /><span style=\"font-size: 18.0pt;\">关机提示:power off</span><br /><span style=\"font-size: 18.0pt;\">配对状态提示:paring</span><br /><span style=\"font-size: 18.0pt;\">连接提示:you device is connect</span><br /><span style=\"font-size: 18.0pt;\">断开连接提示:you device is disconnect</span><br /><span style=\"font-size: 18.0pt;\">低电提示:battery low</span><br /><span style=\"font-size: 18.0pt;\">按键功能:长按开机,长按关机,单击音乐暂停/播放/来电接听/挂断电话,双击下一曲。</span><br /><span style=\"font-size: 18.0pt;\">充电指示说明:</span><br /><span style=\"font-size: 18.0pt;\">耳机充电指示灯:耳机充电红灯亮,电池充满后红灯熄灭。</span><br /><span style=\"font-size: 18.0pt;\">充电盒充电指示:</span><br /><span style=\"font-size: 18.0pt;\">1.充电盒给耳机充电时:充电盒上绿色LED灯闪烁,给耳机充满后绿色LED灯熄灭。</span><br /><span style=\"font-size: 18.0pt;\">2.给充电盒充电时:充电盒上绿色LED灯</span><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/566/139/9337931665_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/382/444/9294444283_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/089/709/9337907980_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/325/579/9396975523_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/685/279/9396972586_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/990/040/9442040099_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/926/130/9442031629_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/353/114/9421411353_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/078/783/9421387870_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/895/430/9442034598_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/045/579/9396975540_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/006/279/9396972600_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/211/040/9442040112_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/746/130/9442031647_552744963.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/473/114/9421411374_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/788/783/9421387887_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/516/430/9442034615_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/820/534/9421435028_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/047/204/9421402740_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/052/324/9421423250_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/522/624/9421426225_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/647/504/9421405746_552744963.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2018/552/024/9421420255_552744963.jpg\" /><br /></span></p>"};
去掉var offer_details= 解析json
使用content 内容 然后进行HTML解析
图片路径
img
样式
<imgalt="undefined" src="https://cbu01.alicdn.com/img/ibank/2018/895/430/9442034598_552744963.jpg"/>
这是一个列表 使用src 属性
pc端接口
https://tui.taobao.com/recommend?appid=9151&module=&item_id=39582591624&count=9
pc端接口返回
{"result": [{"itemId": 567724573768,"score": 34.9095380638643,"itemTitle": "倍量锂可充 5号全新充电电池 1.5V恒压玩具话筒 五号AA 充电锂电","biz30day": 162,"volume30day": 162,"url": "https://detail.1688.com/offer/567724573768.html?scm=1007.19151.114112.0","price": 0,"reservePrice": 21,"qualityScore": 58,"qualityGrade": "5","soldQuanity": 0,"picUrl": "img/ibank/2018/165/649/9206946561_320624636.jpg","userId": 2074087698,"memberId": "b2b-2074087698","cateId": 1032303,"cateName": "充电电池","cateLv1Id": 5,"cateLv1Name": "电工电气","pinleiId": 732,"pinleiName": "电工电气","pid": "","tags": "194498,192002,213250,17474,18754,16962,18114,16834,16514,17922,18050,17538,17026,17410,17282,91010,98306,265218,270594"}],"scm": "1007.19151.114112.0","version": 1,"pvid": "602c76c3-3669-4e01-bf21-852e361e03be","tpp_trace": "0b0ad9da15486649584378927e64ab"}
m端接口 (和淘宝接口一致)
GET https://h5api.m.1688.com/h5/mtop.1688.offerdetailmobileservice.findrecommendofferinfo/1.1/?appKey=12574478&t=1548664272930&sign=e9cdb5071fc4ba03ab85a8257de0957f&data=%7B%22offerId%22%3A%22570948906315%22%2C%22visitorMembeId%22%3A%22%22%2C%22parametersMap%22%3A%22%7B%5C%22ptow%5C%22%3A%5C%22113d26e7c9a%5C%22%2C%5C%22_server_name%5C%22%3A%5C%22details.1688.com%5C%22%2C%5C%22visitorIp%5C%22%3A%5C%2211.131.125.163%5C%22%2C%5C%22_server_port%5C%22%3A%5C%2280%5C%22%2C%5C%22no_cache%5C%22%3A%5C%22true%5C%22%2C%5C%22sk%5C%22%3A%5C%22consign%5C%22%2C%5C%22spm%5C%22%3A%5C%22a26g8.7664810.0.0%5C%22%7D%22%7D HTTP/1.1
m端接口返回
{"api": "mtop.1688.offerdetailmobileservice.findrecommendofferinfo","v": "1.1","ret": ["SUCCESS::调用成功"],"data": {"result": {"majorRecommendReason": null,"relationRecommendReason": null,"majorRecommendOfferInfos": [{"saleAmount": "2323","publishTime": "1502266117000","unit": "件","cornerIcon": "","price": "8.0","imageUrl": "https://cbu01.alicdn.com/img/ibank/2018/520/135/9755531025_552744963.jpg","promotionBenefitInfos": [],"bestOffer": "false","bigPromotion": "false","offerId": "556714040121","title": "新款A10蓝牙音箱 铝合金带灯电脑音响 插卡小钢炮收音机蓝牙音箱","publishWithin7days": "false"}],"relationRecommendOfferInfos": [{"saleAmount": "2396","publishTime": "1532526688000","unit": "套","cornerIcon": "","price": "25.0","imageUrl": "https://cbu01.alicdn.com/img/ibank/2018/559/969/9396969955_552744963.jpg","promotionBenefitInfos": [],"bestOffer": "false","bigPromotion": "false","offerId": "574327846531","title": "i7s-tws双耳蓝牙耳机亚马逊跨境爆款 入耳式无线运动i7蓝牙耳机","publishWithin7days": "false"}],"shopSimilarRecommendOfferInfos": [{"saleAmount": "0","publishTime": "1542610372000","unit": "条","cornerIcon": "","price": "85.0","imageUrl": "https://cbu01.alicdn.com/img/ibank/2019/001/370/10302073100_552744963.jpg","promotionBenefitInfos": [],"bestOffer": "false","bigPromotion": "false","offerId": "582106080497","title": "i9s瑞昱5.0双边通话蓝牙耳机 i8x立体声无线蓝牙耳机 i10触控耳机","publishWithin7days": "false"}]},"resultCode": "0"}}