title: Fetch Data from a web page to Excel using VBA
body: <p>I am trying to pull data from the following web page.</p>
  
  <p><a href="https://pro.calnea.com/login" rel="nofollow">https://pro.calnea.com/login</a></p>
  
  <p>User: tyronr@outlook.com</p>
  
  <p>Pass: calnea1</p>
  
  <p>Once logged in hoover over "Pro Services" and click "Comps Search (Photo)". I have typed a post code in and ticked a couple of properties already which should put them in the Shortlist. To access the short list go to the bottom on the page and on the right, there is a button which says "View Shortlist", click that. Now you see the selected properties and I want to pull each piece of data for each property, for example, cell A1 = Address, A2 = Last Sales Price, A3 = Last Sales Date etc all the way to Status. Then the next property on the next line so B1 = Address etc. If possible I want to get the image URL as well.  </p>
  
  <p>I am not sure of the best way around this as there is a log in however I am remaining logged in on the browser so I assume this isnt an issue?</p>
  
  <p>Below is what I have so far but unfortunately I am having no luck and help would be MUCH appreciated! :)</p>
  
  <pre><code>Sub test()
  Dim eRow As Long
  Dim ele As Object
  Set sht = Sheets("Sheet1")
  RowCount = 1
  sht.Range("A" &amp; RowCount) = "Address"
  sht.Range("B" &amp; RowCount) = "Last Sales Price"
  sht.Range("C" &amp; RowCount) = "Last Sales Date"
  sht.Range("D" &amp; RowCount) = "Property Type"
  
  eRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
  
  Set objIE = CreateObject("InternetExplorer.Application")
  
  
  With objIE
  .Visible = True
  .navigate "http://pro.calnea.com/client/cmp_shortlist/bs6?Require_EA=false&amp;SearchMode=CMP"
  Do While .Busy Or _
  .readyState &lt;&gt; 4
  DoEvents
  Loop
  Set what = .document.getElementsByName("q")
  what.Item(0).Value = Address
  Set Address = .document.getElementsByName("where")
  Address.Item(0).Value = Last Sales Price
  .document.getElementById("View Shortlist").Click
  Do While .Busy Or _
  .readyState &lt;&gt; 4
  DoEvents
  Loop
  For Each ele In .document.all
  Select Case ele.classname
  Case "Result"
  RowCount = RowCount + 1
  Case "Title"
  sht.Range("A" &amp; RowCount) = ele.innertext
  Case "Company"
  sht.Range("B" &amp; RowCount) = ele.innertext
  Case "Location"
  sht.Range("C" &amp; RowCount) = ele.innertext
  Case "Description"
  sht.Range("D" &amp; RowCount) = ele.innertext
  End Select
  Next ele
  End With
  Macro1
  Set objIE = Nothing
  End Sub
  </code></pre>