![]() ![]() The code required to automate the process would not work on other sites (since every site is setup differently) and would not be worth the time of developing and keeping up on the code. Why would you need custom VBA to get data from a site like this. Microsoft XML, V6.0 ''Or whatever version you have With topic.getElementsB圜lassName("our_price") Length Then row = row + 1: Cells(row, 1) =. With topic.getElementsB圜lassName("product_name") ![]() It should take no longer than 5 seconds to fetch you all the data: Sub Web_Data()ĭim http As New XMLHTTP60, html As New HTMLDocument, page As Long, row As Longįor Each topic In html.getElementsB圜lassName("listing_item span4") When there is a robust method out there, why stick to IE. Range("C9").Offset(i + (i2 * 30), (0)).Value = doc.getElementsB圜lassName("maincontent")(0).getElementsB圜lassName("product_listing")(0).getElementsB圜lassName("row-fluid")(0).getElementsB圜lassName("listing_item span4")(0).getElementsB圜lassName("price-row")(0).getElementsB圜lassName("product_name")(0).innerText Range("B9").Offset(i + (i2 * 30), (0)).Value = doc.getElementsB圜lassName("maincontent")(0).getElementsB圜lassName("product_listing")(0).getElementsB圜lassName("row-fluid")(0).getElementsB圜lassName("listing_item span4")(0).getElementsB圜lassName("price-row")(0).getElementsB圜lassName("left-col")(0).innerText Loop Until ie.readyState = READYSTATE_COMPLETE Set ie = CreateObject("InternetExplorer.Application")Īpplication.Wait (Now + TimeValue("0:00:02")) Can someone point to the mistakes I am making in completing this Program? Sub printnumbs() I want it to access this knife website, take the name and price and store them onto the sheet, move to the next item, and once finished on that page, continue onto the next pages until all items have been scraped. ![]() I am very new to VBA and am having problems on the final details of this query. I am building a VBA web scraper to grab all the names of an item and the prices of an item. ![]()
0 Comments
Leave a Reply. |