title: Shipment tracking, returning date gives Run Time Error 424 Object Required
body: <p>So I'm working on a project for a coworker and I've run into an issue. I've never worked with Excel VBA before and I have VERY little training in coding at all. StackOverflow and dozens of other websites have been a huge help. I'm just not sure where to go for this.</p>
  
  <p>The goal.</p>
  
  <ul>
  <li>navigate to a webpage</li>
  <li>wait for page to load</li>
  <li>Return the delivery date back to excel (cell b1)</li>
  </ul>
  
  <p>Here's my code so far</p>
  
  <pre><code>Public Function RoadRunnerTracking()
  Dim IE1 As Object
  Dim DeliveryCollection As Object
  Dim ProUrl As String
  
  
  Set IE1 = CreateObject("InternetExplorer.application")
  
  ProUrl = "https://www.rrts.com/Tools/Tracking/Pages/MultipleResults.aspx?PROS=" &amp; Range("a1")
  
  With IE1
      .Visible = True
      .Navigate ProUrl
      Do Until Not IE1.Busy And IE1.readyState = 4: DoEvents: Loop
  End With
  
  Set DeliveryCollection = Trim(IE1.document.getElementsByTagName("Span")(16).innerText) 'THIS LINE RETURNS A RUN TIME ERROR 424 OBJECT REQUIRED
  Range("b1").Value = DeliveryCollection
  Set IE1 = Nothing
  
  End Function
  </code></pre>
  
  <p>This isn't a polished function yet I'm aware. I'm just trying to work out some kinks.</p>
  
  <p>What I don't understand is that I tested that line in another function and it worked fine. I cheated on the test function pasting the link directly to the results page rather than running the tracking number, but I would think it would be the same.</p>
  
  <p>Here is the code that the line seems to work in.</p>
  
  <pre><code>Public Function PartTwoTest()
  Dim IE1 As Object
  
  Set IE1 = CreateObject("InternetExplorer.application")
  
  With IE1
      .Visible = True
      .Navigate "https://www.rrts.com/Tools/Tracking/Pages/MultipleResults.aspx?PROS=359607744"
      Do Until IE1.readyState = 4
      DoEvents
      Loop
  End With
  
  DeliveryCollection = Trim(IE1.document.getElementsByTagName("Span") (16).innerText)
  Range("b1").Value = DeliveryCollection
  
  Set IE1 = Nothing
  
  End Function
  </code></pre>
  
  <p>Any help would be appreciated.</p>