dewu-api 价格接口更新

在这里插入图片描述

{
  "success": true,
  "code": 200,
  "message": null,
  "data": [
    {
      "highestPrice": 0,
      "score": 0,
      "size": "0",
      "highestBid": 0,
      "price": 0,
      "platForm": "dw",
      "picture": "https://cdn.poizon.com/pro-img/origin-img/20220212/b0b1a2e6706e4238b425a1b9107e2863.jpg"
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "36",
      "highestBid": 0,
      "price": 0,
      "platForm": "",
      "skuId": 602264002
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "38.5",
      "highestBid": 0,
      "price": 1089,
      "platForm": "",
      "skuId": 601891938
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "39",
      "highestBid": 0,
      "price": 989,
      "platForm": "",
      "skuId": 197442565
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "40",
      "highestBid": 0,
      "price": 899,
      "platForm": "",
      "skuId": 197442589
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "40.5",
      "highestBid": 0,
      "price": 829,
      "platForm": "",
      "skuId": 197442592
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "41",
      "highestBid": 0,
      "price": 909,
      "platForm": "",
      "skuId": 197442607
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "42",
      "highestBid": 0,
      "price": 999,
      "platForm": "",
      "skuId": 197442612
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "42.5",
      "highestBid": 0,
      "price": 989,
      "platForm": "",
      "skuId": 197442613
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "43",
      "highestBid": 0,
      "price": 849,
      "platForm": "",
      "skuId": 197442618
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "44",
      "highestBid": 0,
      "price": 789,
      "platForm": "",
      "skuId": 197442626
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "44.5",
      "highestBid": 0,
      "price": 749,
      "platForm": "",
      "skuId": 197442627
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "45",
      "highestBid": 0,
      "price": 689,
      "platForm": "",
      "skuId": 197442631
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "45.5",
      "highestBid": 0,
      "price": 0,
      "platForm": "",
      "skuId": 197442633
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "46",
      "highestBid": 0,
      "price": 989,
      "platForm": "",
      "skuId": 197442641
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "46.5",
      "highestBid": 0,
      "price": 0,
      "platForm": "",
      "skuId": 197442642
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "47",
      "highestBid": 0,
      "price": 0,
      "platForm": "",
      "skuId": 602054156
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "47.5",
      "highestBid": 0,
      "price": 899,
      "platForm": "",
      "skuId": 197442645
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "48",
      "highestBid": 0,
      "price": 0,
      "platForm": "",
      "skuId": 197442648
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "48.5",
      "highestBid": 0,
      "price": 0,
      "platForm": "",
      "skuId": 602054155
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "49.5",
      "highestBid": 0,
      "price": 0,
      "platForm": "",
      "skuId": 602054154
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "50.5",
      "highestBid": 0,
      "price": 0,
      "platForm": "",
      "skuId": 612690514
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "51.5",
      "highestBid": 0,
      "price": 0,
      "platForm": "",
      "skuId": 615712993
    },
    {
      "highestPrice": 0,
      "score": 0,
      "size": "52.5",
      "highestBid": 0,
      "price": 0,
      "platForm": "",
      "skuId": 617082393
    }
  ]
}
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
下面是一个简单的优化方案: 1. 使用Excel内置的Web查询功能,直接从得物网站上抓取价格信息。 2. 将sku和价格信息保存到一个字典中,避免重复查询。 3. 在查询时,首先检查字典中是否已经存在该sku的价格信息,如果存在,则直接使用该信息,否则进行Web查询,并将查询到的价格信息保存到字典中。 下面是一个示例的VBA代码: ```VBA Option Explicit Private priceDict As Object Sub getPrice() Dim lastRow As Long Dim sku As String Dim url As String Dim html As String Dim price As String ' 初始化字典 Set priceDict = CreateObject("Scripting.Dictionary") lastRow = Cells(Rows.Count, 1).End(xlUp).Row For i = 1 To lastRow sku = Cells(i, 1).Value If priceDict.exists(sku) Then price = priceDict(sku) Else url = "https://detail.dewu.com/item?id=" & sku With ActiveSheet.QueryTables.Add(Connection:= _ "URL;" & url, Destination:=Range("$B$" & i)) .Name = "item?id=" & sku .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlSpecifiedTables .WebFormatting = xlWebFormattingNone .WebTables = "class:price-num" .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With price = Cells(i, 2).Value priceDict.Add sku, price End If Next i End Sub ``` 这个示例中,我们使用了Excel内置的Web查询功能来抓取得物网站上的价格信息。在查询时,我们首先检查字典中是否已经存在该sku的价格信息,如果存在,则直接使用该信息,否则进行Web查询,并将查询到的价格信息保存到字典中。这样就可以避免重复查询,提高效率。 需要注意的是,在使用Web查询时,需要将查询结果保存到指定的单元格中,然后再从该单元格中读取价格信息。在上面的代码中,我们将查询结果保存到B列中,然后从B列中读取价格信息。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值