I am grabbing prices from one of my Vendors web shopping cart
The cart uses tables with some divs inside the table
But I am having trouble extracting text inside the tables from just the td's
I am doing this via Visual Basic in Excel 2007 - VendorURL is a variable and so is Xpath in my code shown below
This is the example page link
Page link is here
I can get the the whole table by doing this
Xpath = "//*[@id='itemPrice1713']/div1/table"
Worksheets(WorkSheet2).Cells(1, 1).Value = Application.Run("XPathOnUrl", VendorURL, Xpath)
The code above fetches the whole table and that data looks like this
QuantityPrice1 9$31.8310 19$30.2420 99$28.65100 +$28.01
Ok, so fetching the whole table works, but now I want to extract data from rows and columns separately
This is the xpath to one of the td's in the table
Xpath = "//*[@id='itemPrice1713']/div1/table/tbody/tr[5]/td[2]"
Worksheets(WorkSheet2).Cells(1, 1).Value = Application.Run("XPathOnUrl", VendorURL, Xpath)
I get nothing but a blank cell from the example above
What am I doing wrong here?
Thanks for any help
This is what the table looks like on the web page example
<table class="bglt" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="smalltext">
<div class="listheadernosort">Quantity</div>
</td>
<td class="smalltext">
<div class="listheadernosort">Price</div>
</td>
</tr>
<tr>
<td class="texttable" nowrap="">1 – 9</td>
<td class="texttable">$31.83</td>
</tr>
<tr>
<td class="texttable" nowrap="">10 – 19</td>
<td class="texttable">$30.24</td>
</tr>
<tr>
<td class="texttable" nowrap="">20 – 99</td>
<td class="texttable">$28.65</td>
</tr>
<tr>
<td class="texttable" nowrap="">100 +</td>
<td class="texttable">$28.01</td>
</tr>
</tbody>
</table>