microsoft excel vba从网页复制数据

microsoft excel vba从网页复制数据,excel,vba,Excel,Vba,通过vba-我需要转到,然后在“跟踪方式”下拉列表中选择“Hawb/direct awb no.”选项,将从excel复制的单元格输入“数字”字段,然后单击“提交”按钮 我怎么做?我正在使用excel 10和IE 10。我尝试了以下各种命令,但没有成功:( 更新: 我遵循了下面罗恩的回答。我想复制罗恩的代码完成处理后得到的表。 我用了追踪号码-PEN91227308 我尝试了以下命令。但它复制的数据不是表格格式。当我将其粘贴到excel中时,整行显示在单个单元格中。如何将该数据转换为网页上的表

通过vba-我需要转到,然后在“跟踪方式”下拉列表中选择“Hawb/direct awb no.”选项,将从excel复制的单元格输入“数字”字段,然后单击“提交”按钮

我怎么做?我正在使用excel 10和IE 10。我尝试了以下各种命令,但没有成功:(


更新:

我遵循了下面罗恩的回答。我想复制罗恩的代码完成处理后得到的表。 我用了追踪号码-PEN91227308

我尝试了以下命令。但它复制的数据不是表格格式。当我将其粘贴到excel中时,整行显示在单个单元格中。如何将该数据转换为网页上的表格格式

Dim clipboard As MSForms.DataObject
Set clipboard = New MSForms.DataObject
clipboard.PutInClipboard
clipboard.SetText Doc.getElementById("ctl00_contentPlaceHolderRoot_grdVwHistory").innerHTML

您试图与之交互的元素包含在IFrame中

   <iframe name="Shipment Tracking" width="100%" height="450" id="content_iframe" src="http://apps.dbschenkerusa.com/apps/Tracking/" frameborder="0" scrolling="auto">

你可以尝试一下,就像hhh一样。需要一些帮助。我安装了excel插件,然后打开firefox,然后打开selenium,但似乎没有任何效果:(有帮助吗?如何录制脚本…我也去了excel和“Dim driver as New SeleniumWrapper.WebDriver”,但我遇到了一个错误:(我只安装了excel包装器您需要IDE和包装器
   <iframe name="Shipment Tracking" width="100%" height="450" id="content_iframe" src="http://apps.dbschenkerusa.com/apps/Tracking/" frameborder="0" scrolling="auto">
Sub test1()
' open IE, navigate to the website of interest and loop until fully loaded
    Set ie = CreateObject("InternetExplorer.Application")
  '  my_url = "http://www.dbschenkerusa.com/log-us-en/start/eschenkerusa/shipmenttracking.html"
    my_url = "http://apps.dbschenkerusa.com/apps/Tracking/"

    With ie
        .Visible = True
        .navigate my_url
        .Top = 50
        .Left = 530
        .Height = 400
        .Width = 400

    Do Until Not ie.Busy And ie.readyState = 4
        DoEvents
    Loop

    End With

' Select the appropriate item from the drop-down box
    ie.Document.getElementById("ctl00_contentPlaceHolderRoot_cboTrackBy").Value = "aw"

' Enter a value in the "Number" text box
    ie.Document.getElementById("ctl00_contentPlaceHolderRoot_txtTrackBy").Value = "1234"

' Click the submit button
    ie.Document.getElementById("ctl00_contentPlaceHolderRoot_linkButtonSubmit").Click

End Sub