title: VBA web Scraping problems
body: <p>I am building a VBA web scraper to grab all the names of an item and the prices of an item. I am very new to VBA and am having problems on the final details of this query.</p>
  
  <p>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. Can someone point to the mistakes I am making in completing this Program?</p>
  
  <pre><code>Sub printnumbs()
  '
  Dim i As Integer
  For i = 0 To 10
  
  Range("D6").Offset(0, (i * 2)).Value = i + 2
  
  Next i
  
  '
  End Sub
  Sub scrape()
  
  Dim i2 As Integer
  
  
  Dim ie As Object
  
  
      Set ie = CreateObject("InternetExplorer.Application")
      With ie
      .Visible = True
  
      For i2 = 1 To 2
      'Max is For i2 = 0 To 400
  
  
      .navigate "https://www.knifecenter.com/kc_new/store_store.html?ttl=Hunting%20and%20Bushcraft%20Knives&amp;desc=Hunting%20Bushcraft&amp;wnWWWCAT_1datarq=video&amp;wnWWWCAT_1datarq=notepad&amp;s=" &amp; (i2 + (i2 * 30))
      Application.Wait (Now + TimeValue("0:00:02"))
      Do
      DoEvents
      Loop Until ie.readyState = READYSTATE_COMPLETE
      Dim doc As HTMLDocument
      Set doc = ie.document
      While ie.readyState &lt;&gt; 4
      Wend
  
      On Error Resume Next
  
      Dim i As Integer
      For i = 0 To 29
  
  
      Range("B9").Offset(i + (i2 * 30), (0)).Value = doc.getElementsByClassName("maincontent")(0).getElementsByClassName("product_listing")(0).getElementsByClassName("row-fluid")(0).getElementsByClassName("listing_item span4")(0).getElementsByClassName("price-row")(0).getElementsByClassName("left-col")(0).innerText
      Range("C9").Offset(i + (i2 * 30), (0)).Value = doc.getElementsByClassName("maincontent")(0).getElementsByClassName("product_listing")(0).getElementsByClassName("row-fluid")(0).getElementsByClassName("listing_item span4")(0).getElementsByClassName("price-row")(0).getElementsByClassName("product_name")(0).innerText
  
  
      Next i
      Next i2
      ie.Quit
           Application.EnableEvents = True
  
  End With
  
  
  '
  End Sub
  </code></pre>