Sub Scrape_YMS()
'User: 020885
'Pass: Ilovealisha@22
Dim objIE As InternetExplorer
Dim itemEle As Object
Set objIE = New InternetExplorer
objIE.Visible = True
objIE.navigate "https://whelo.4sightsolution.net/dockKiosk/dockKioskList?dockGroupId=76"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
On Error GoTo err_clear
'For the results, set the start row and Set the sheet so you don't have to repeat the name
ResRw = 1
Set Sht = Sheets("Sheet1")
For Each itemEle In objIE.document.getElementsByClassName("kioskDockDoor")
'Every kioskDockDoor goes on a new line, so reset the column to 2
ResCol = 2
For Each d In itemEle.getElementsByClassName("kioskLabel")
'First write the kioskLabel, after that the next Sibling (which should be the trailerId)
Sht.Cells(ResRw, ResCol).Value = d.innerHTML
Sht.Cells(ResRw + 1, ResCol).Value = d.nextElementSibling.innerHTML
'For the next result, add 1 to the column
ResCol = ResCol + 1
Next d
'For the next result, add 2 to the row
ResRw = ResRw + 2
Next
objIE.navigate "https://whelo.4sightsolution.net/dockKiosk/dockKioskList?dockGroupId=75"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
On Error GoTo err_clear
'For the results, set the start row and Set the sheet so you don't have to repeat the name
ResRw = 5
Set Sht = Sheets("Sheet1")
For Each itemEle In objIE.document.getElementsByClassName("kioskDockDoor")
'Every kioskDockDoor goes on a new line, so reset the column to 2
ResCol = 2
For Each d In itemEle.getElementsByClassName("kioskLabel")
'First write the kioskLabel, after that the next Sibling (which should be the trailerId)
Sht.Cells(ResRw, ResCol).Value = d.innerHTML
Sht.Cells(ResRw + 1, ResCol).Value = d.nextElementSibling.innerHTML
'For the next result, add 1 to the column
ResCol = ResCol + 1
Next d
'For the next result, add 2 to the row
ResRw = ResRw + 2
Next
objIE.navigate "https://whelo.4sightsolution.net/dockKiosk/dockKioskList?dockGroupId=84"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
On Error GoTo err_clear
'For the results, set the start row and Set the sheet so you don't have to repeat the name
ResRw = 11
Set Sht = Sheets("Sheet1")
For Each itemEle In objIE.document.getElementsByClassName("kioskDockDoor")
'Every kioskDockDoor goes on a new line, so reset the column to 2
ResCol = 2
For Each d In itemEle.getElementsByClassName("kioskLabel")
'First write the kioskLabel, after that the next Sibling (which should be the trailerId)
Sht.Cells(ResRw, ResCol).Value = d.innerHTML
Sht.Cells(ResRw + 1, ResCol).Value = d.nextElementSibling.innerHTML
'For the next result, add 1 to the column
ResCol = ResCol + 1
Next d
'For the next result, add 2 to the row
ResRw = ResRw + 2
Next
objIE.navigate "https://whelo.4sightsolution.net/dockKiosk/dockKioskList?dockGroupId=85"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
On Error GoTo err_clear
'For the results, set the start row and Set the sheet so you don't have to repeat the name
ResRw = 13
Set Sht = Sheets("Sheet1")
For Each itemEle In objIE.document.getElementsByClassName("kioskDockDoor")
'Every kioskDockDoor goes on a new line, so reset the column to 2
ResCol = 2
For Each d In itemEle.getElementsByClassName("kioskLabel")
'First write the kioskLabel, after that the next Sibling (which should be the trailerId)
Sht.Cells(ResRw, ResCol).Value = d.innerHTML
Sht.Cells(ResRw + 1, ResCol).Value = d.nextElementSibling.innerHTML
'For the next result, add 1 to the column
ResCol = ResCol + 1
Next d
'For the next result, add 2 to the row
ResRw = ResRw + 2
Next
objIE.navigate "https://whelo.4sightsolution.net/dockKiosk/dockKioskList?dockGroupId=108"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
On Error GoTo err_clear
'For the results, set the start row and Set the sheet so you don't have to repeat the name
ResRw = 15
Set Sht = Sheets("Sheet1")
For Each itemEle In objIE.document.getElementsByClassName("kioskDockDoor")
'Every kioskDockDoor goes on a new line, so reset the column to 2
ResCol = 2
For Each d In itemEle.getElementsByClassName("kioskLabel")
'First write the kioskLabel, after that the next Sibling (which should be the trailerId)
Sht.Cells(ResRw, ResCol).Value = d.innerHTML
Sht.Cells(ResRw + 1, ResCol).Value = d.nextElementSibling.innerHTML
'For the next result, add 1 to the column
ResCol = ResCol + 1
Next d
'For the next result, add 2 to the row
ResRw = ResRw + 2
Next
err_clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
objIE.Quit
End Sub