title: Excel VBA find webpage image and import it into excel
body: <p>Currently I am trying to search an open webpage for a number of png images and import them into different cells in a tab on my excel workbook. </p>
  
  <p>My existing macro navigates a webpage which dictates what pictures will be showing and how many there are.</p>
  
  <p>I am trying to write a macro to at this point search the open webpage and import the image to excel.</p>
  
  <p>The number of images cannot be known each time the program is run. However each image is in the following html code:</p>
  
  <pre><code>img src="/files/exercises/31a_3 - trunk stability rotation kneex flexed.still002.194x146.png" title="Step 2"
  </code></pre>
  
  <p>While the file names will change. I am looking for all the images with the title="Step 2"</p>
  
  <p>And import all these images to excel.
  At the current moment I can successfuly find the urls by the following code:</p>
  
  <pre><code>max = 100
  For i = 0 To max
  For Each Elem In ie.Document.getElementsByTagName("img")
  If ie.Document.getElementsByTagName("img").Item(i).getAttribute("title") = "Step 2" Then
  Worksheets("Sheet4").Range("A1") = "http://functionalmovement.com" &amp; ie.Document.getElementsByTagName("img").Item(i).getAttribute("src")
  Exit For
  Exit For
  End If
  Next
  Next
  End Sub
  </code></pre>
  
  <p>Issues:</p>
  
  <ol>
  <li><p>How can I search the entire page and have the first found put in a specific cell, the second found put in another cell and so on until no more are found.</p></li>
  <li><p>Is there a way to have the image itself appear now that the full url is known for each image.</p></li>
  </ol>