title: Using selenium VBA bringing the cell values from a dynamic web page table to excel cells
body: <p>I am new to selenium VBA and post googling have crated the below code in  order to bring the each cell value from a dynamic webpage using the selenium vba. I am getting error in receiving the web elements in a web_tr and web_td web elements</p>
  
  <p>Have trying with this line:</p>
  
  <pre><code>ActiveSheet.Cells(i, 1).Value = selenium.findElementByXPath("//table[@id='ctl00_cphContentBody_itemsTable']/tbody/tr['i']/td[1]").Text
  </code></pre>
  
  <p>I am getting a header line item first value only though it is under the loop.</p>
  
  <p>Web_tr and web_td are web elements and receiving the web elements to these variables are the issue here. Kindly assist.</p>
  
  <hr>
  
  <pre><code>With ThisWorkbook
          .Sheets("UpfrontOrder#").Activate
  
         Set web_table = selenium.findElementsByXPath("//table[@id='ctl00_cphContentBody_itemsTable']/tbody")
         Set web_tr = web_table.findElementsByTagName("tr")   '***** the error pop-up gets in here****
         row_count = selenium.findElementsByXPath("//table[@id='ctl00_cphContentBody_itemsTable']/tbody/tr").Count
  
         For i = 1 To row_count
              Set web_td = web_tr.findElementsByTagName("td")
              ActiveSheet.Cells(i, 1).Value = web_td(1).getText
  
              'ActiveSheet.Cells(i, 1).Value = selenium.findElementByXPath("//table[@id='ctl00_cphContentBody_itemsTable']/tbody/tr['i']/td[1]").Text
              ActiveSheet.Cells(i, 2).Value = selenium.findElementByXPath("//table[@id='ctl00_cphContentBody_itemsTable']/tbody/tr['i']/td[2]").Text
              ActiveSheet.Cells(i, 3).Value = selenium.findElementByXPath("//table[@id='ctl00_cphContentBody_itemsTable']/tbody/tr['i']/td[3]").Text
              ActiveSheet.Cells(i, 4).Value = selenium.findElementByXPath("//table[@id='ctl00_cphContentBody_itemsTable']/tbody/tr['i']/td[4]").Text
              ActiveSheet.Cells(i, 5).Value = selenium.findElementByXPath("//table[@id='ctl00_cphContentBody_itemsTable']/tbody/tr['i']/td[5]").Text
              ActiveSheet.Cells(i, 6).Value = selenium.findElementByXPath("//table[@id='ctl00_cphContentBody_itemsTable']/tbody/tr['i']/td[6]").Text
              ActiveSheet.Cells(i, 7).Value = selenium.findElementByXPath("//table[@id='ctl00_cphContentBody_itemsTable']/tbody/tr['i']/td[7]").Text
  
              'ActiveSheet.Cells(i, 1).Value = web_td.findElementByXPath("td[1]").Text
              'ActiveSheet.Cells(i, 2).Value = web_td(1).Text
  
          Next i
  End With
  </code></pre>