Código: Selecionar todos
Sub GERADOLINKSPLAN5()
Dim driver As New ChromeDriver
'driver.AddArgument ("--headless")
linha = 1
over05 = 0
Range("I1").Select
While Cells(linha, 1) <> ""
If Cells(linha, 1) <> "" Then
driver.Get "" & Cells(linha, 5)
Set todosOsLinks = driver.FindElementByXPath("//div[3]/div/table/tbody/tr[5]/td[7]").FindElementsByTag("a")
For Each linkUnico In todosOsLinks
driver.Get "" & linkUnico.Attribute("href")
Dim tbl As TableElement
Set tbl = driver.FindElementByXPath("//*[@id=""info""]/table/tbody").AsTable
Dim Data()
Data = tbl.Data
Value1 = UBound(Data, 1) - LBound(Data, 1)
Dim separar As Double
Dim Texto, a() As String
Texto = Data(1 + 1, 6)
a() = Split(Texto, "-")
For r1 = 1 To UBound(Data, 1) - LBound(Data, 1)
Texto = Data(r1 + 1, 6)
a() = Split(Texto, "-")
separar = a(1)
If a(0) + separar <= "3" Then
over05 = over05 + 1
End If
Next
linha = linha + 1
ActiveCell.Value = over05
ActiveCell.Offset(0, -2).Value = Value1
ActiveCell.Offset(1, 0).Select
Next linkUnico
End If
Wend
End Sub