首页 > 解决方案 > 编辑已售商品 Ebay Scrape VBA

问题描述

寻找一种通过 excel VBA 执行此操作的两种方法之一。

1) 在 ebay 上搜索零件号并返回已售商品的数量,或者;

2) 使用直接链接执行相同的任务。

有任何想法吗?

我努力了:

Public Sub GetNumberSold() Dim html As HTMLDocument

Set html = New HTMLDocument

With CreateObject("MSXML2.XMLHTTP")
    .Open "GET", "https://www.ebay.com/itm/VIRGINIA-CAVALIERS-FINAL-FOUR-National-FREAKIN-Champions-T-Shirt-Gildan/352639122861", False
    .send
    html.body.innerHTML = .responseText
End With

MsgBox html.querySelector(".vi-txt-underline").innerText
Debug.Print Replace$(html.querySelector(".vi-txt-underline").innerText," sold",vbNullString)
Debug.Print split(html.querySelector(".vi-txt-underline").innerText,chr$(32))(0)

End Sub

按照下面的要求启用两个对象/引用。

然后我收到以下错误:运行时“91”对象变量或未设置块变量。

标签: htmlexcelvbaweb-scraping

解决方案


推荐阅读