title: Extract data from webpage table using VBA
body: <p>I would like extract the data from table in webpage. 
  my html table code looks like below </p>
  
  <pre><code>&lt;table class=table_x_write cellspacing=1
  bordercolordark=#d5d5d5 cellpadding=0 width="100%"
  align=center bgcolor=#FFFFFF bordercolorlight=#a5a5a5
  border=1&gt;
  &lt;tr&gt;
      &lt;td class="title_1" align="right" width="20%"&gt;
          &lt;div align=right&gt;case number：&lt;/div&gt;&lt;/td&gt;
      &lt;td class="item_1" width="30%"&gt;&lt;input type="text" name="sgdabh" tabindex="1" value="3710140068" readonly="readonly" style="width:98%" class="bg0" id="sgdabhD"&gt;&lt;/td&gt;
      &lt;TD class="title_1" align="right"&gt;participant number：&lt;/td&gt;
      &lt;td class="item_1" width="30%"&gt;&lt;span
          onmouseover="setEnabled('cyfbh',1)"
          onmouseout="setEnabled('cyfbh',2)"&gt; &lt;select name="cyfbh" style="width:100%"&gt;&lt;option value=""&gt;&lt;/option&gt;
          &lt;option value="371014006801" selected="selected"&gt;371014006801-passenger car&lt;/option&gt;
          &lt;option value="371014006802"&gt;371014006802-two/three wheeled motorcycle&lt;/option&gt;&lt;/select&gt; &lt;/span&gt;&lt;/td&gt;
  
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;TD class="title_1" align="right"&gt;licence number - city：&lt;/td&gt;
      &lt;TD class="item_1"&gt;&lt;input type="text" name="cph_cs" value="豫" style="width:98%" class="bg0"&gt;&lt;/TD&gt;
      &lt;TD class="title_1" align="right"&gt;licence number - letter：&lt;/td&gt;
      &lt;td class="item_1"&gt;&lt;input type="text" name="cph_zm" maxlength="5" tabindex="6" value="C" style="width:98%" class="bg0"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;TD class="title_1" align="right"&gt;licence number - number：&lt;/td&gt;
      &lt;TD class="item_1"&gt;&lt;input type="text" name="cph_sz" maxlength="5" value="8****" style="width:98%" class="bg0"&gt;&lt;/TD&gt;
      &lt;TD class="title_1" align="right"&gt;type of vehicle (own definition)：&lt;/td&gt;
      &lt;td class="item_1"&gt;&lt;span
          onmouseover="setEnabled('cllx1',1)"
          onmouseout="setEnabled('cllx1',2)"&gt; &lt;select name="cllx1" style="width:100%"&gt;&lt;option value=""&gt;&lt;/option&gt;
          &lt;option value="2"&gt;2-two/three electric wheeler&lt;/option&gt;
          &lt;option value="3" selected="selected"&gt;3-passenger car(≤9 seats)&lt;/option&gt;
          &lt;option value="4"&gt;4-HGV&lt;/option&gt;
          &lt;option value="5"&gt;5-bus(＞9 seats)&lt;/option&gt;          
          &lt;option value="6"&gt;6-military vehicle&lt;/option&gt;&lt;/select&gt; &lt;/span&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I tried below code </p>
  
  <pre><code>Sub data()
     x = 0
     Set objShell = CreateObject("Shell.Application")
     For Each w In objShell.Windows
         If w.Name = "Internet Explorer" And w.LocationName = "vehicle data"  Then
          Set externalIE = objShell.Windows(x)
          Set externalIEDoc = externalIE.Document
          Set elemCollection = externalIE.Document.getElementsByTagName("TABLE")
          MsgBox (elemCollection.Length)
          For t = 0 To (elemCollection.Length - 1)
              For r = 0 To (elemCollection(t).Rows.Length - 1)
                  For c = 0 To (elemCollection(t).Rows(r).Cells.Length - 1)
                      ThisWorkbook.Worksheets(1).Cells(r + 1, c + 1) = elemCollection(t).Rows(r).Cells(c).innerText
                  Next c
              Next r
          Next t
          MsgBox (w.LocationName)
          externalIEDoc.getelementsbyname("btnDown")(0).Click
      End If
      x = x + 1
  Next
  End Sub
  </code></pre>
  
  <p>but I am getting the junk data. I need the value as 
  case number：3710140068
  participant number：371014006801-passenger car
     I need to extract data from text and selected option. Please help</p>