lundi 6 juin 2016

VBA web parsing advice

I need help with identifying objects in HTML code. I just need to scrape website and get product name and price. For example, here is HTML code for one product. But i have to loop and took informations from other products. How can i make a macro for loop and get all the needed informations ? Thanks a lot in advice.

<div class="prod-item">
<div class="listContainer">
<table>
<tbody>
<tr>
<td class="listActionCheckbox"><input class="wishListItemCheckBox" name="checkbox" type="checkbox" value="S1990030100810090000" /></td>
<td class="productImageTd " headers="header1">
<div class="product_image clearfix"><a class="prod_Link" href="/nl-be/Hygiene-en-verzorging/Mondverzorging/Tandpasta/Tandpasta-7C-Anti-vlekken-7C-Dagelijks-gebruik/p/S1990030100810090000"> <img class="prodImgRow" title="Tandpasta | Anti-vlekken | Dagelijks gebruik" src="http://ift.tt/1t1tvE6" alt="Tandpasta | Anti-vlekken | Dagelijks gebruik" /> </a></div>
</td>
<td class="productImgDescWrap table_product_details verticalCenter" headers="header2">
<div class="productDetailsSection">
<p class="product_name"><span class="productName">Denivit</span> <br /> <a class="productInfo" href="/nl-be/Hygiene-en-verzorging/Mondverzorging/Tandpasta/Tandpasta-%7C-Anti-vlekken-%7C-Dagelijks-gebruik/p/S1990030100810090000">Tandpasta | Anti-vlekken | Dagelijks gebruik</a></p>
</div>
</td>
<td class="two promotions"><!-- Promotion Simple Message --></td>
<td class="price">
<div class="unformatted"><span class="currencyPrice">&euro;</span><span id="totalint" class="valuePrice">2</span><span id="totalfraction" class="sup">99</span></div>
<span class="price_desc">5 cl - 59,80 &euro;/l</span></td>
<td class="actions clearfix">
<div class="addToTheList"><a class="addToList addToList_" title="" href="#" rel="addToList" data-original-title=""> <img src="http://ift.tt/1Y3dklq" alt="Aan een boodschappenlijst toevoegen" /> </a>
<div class="addToListPopoverContent">&nbsp;</div>
</div>
<div class="cart table_addToFav"><form id="addToCartFormS1990030100810090000" class="add_to_cart_form left" action="/secured/cart/add" method="get"><input name="productCode" type="hidden" value="S1990030100810090000" /> <input name="redirectUrl" type="hidden" value="/my-account/listView?listName=Moj+list" /> <input name="orderCode" type="hidden" value="" /> <input id="listNameId" name="listName" type="hidden" value="Moj list" /> <input name="sort" type="hidden" value="" />
<div class="adjustBasketContainer"><input id="quantity" class="numberinput qty_S1990030100810090000" autocomplete="off" maxlength="2" name="quantity" size="1" type="text" value="1" /> <button id="addProduct" class="positive addProduct add_S1990030100810090000" title="Toevoegen" name="addProduct" type="button"></button> <button id="removeProduct" class="removeProduct trackRemove remove_S1990030100810090000" title="Verwijderen" name="removeProduct" type="button"></button> <button class="addToBasketBtn btn btn-link" title="Toevoegen aan mandje" type="button" value="S1990030100810090000"> <img src="http://ift.tt/1t1tRdO" alt="list" /> </button>
<div id="NumberInCart_S1990030100810090000" class="cl numberInCart pull-left" data-prod="S1990030100810090000">&nbsp;</div>
</div>
</form></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</pre>




Aucun commentaire:

Enregistrer un commentaire