如何在Excel工作表中使用网页抓取通过标签名称获取标签值?

我每天都会对电子商务网站进行分析,我不得不复制他们的价格。

我想要做的是,我将一个网站的url粘贴到Excel工作表中,并从单元格中的标签名称中获得价格。 网站的来源如下所示:

<table> <td> Price </td> <td> : </td> <td> <input name="Price" type="text" value="148.0000" id="uxMSRPPrice1" style="width: 250px;" /> (In x.xx format) </td> </table> 

我想在我的工作表中得到价格148.0000,使用标签名称=“价格”价格是源代码中的唯一标签

还有一件事,我只能从URL这样的源代码包括视图源(我不能共享原来的客户端URL,所以我把它改为xyz ):

 https://www.xyz com/admin/ProductPage.aspx?ProductID=xxx 

 Public Sub GetValueFromBrowser() ' Keyboard Shortcut: Ctrl+q Dim ie As Object Dim url As String Dim selling As String Dim cost As String url = Selection.Value Set ie = CreateObject("InternetExplorer.Application") With ie .Visible = 1 .navigate url While .Busy Or .readyState <> 4 DoEvents Wend End With Dim Doc As HTMLDocument Set Doc = ie.document selling = Trim(Doc.getElementsByName("sellingPrice")(0).Value) ActiveCell.Offset(0, 1).Value = selling cost = Trim(Doc.getElementsByName("costPrice")(0).Value) ActiveCell.Offset(0, 2).Value = cost ie.Quit End Sub