So I have a list with about 300 URLs from a webpage that I want to scrape once a day.
So far I am blocked in about 5 min after first webpage scraping.
How can I clear cookies and Internet files each time I navigate to the URL?
Is there a way to simulate kind of more like a human behavior?
With ie
Set wks = wb.Sheets("TESTINGS")
For j = 22 To 45
wks.Range(Cells(j, 1), Cells(j, 5)).Interior.ColorIndex = 38
counter = counter + 1
mylink1 = wks.Cells(j, 2).Value
.Visible = True
.Navigate mylink1
While .Busy Or .ReadyState < 4: DoEvents: Wend
Set products = .Document.querySelectorAll(".card.js-product-card")
t = Timer
Do
DoEvents
ie.Document.parentWindow.execScript "window.scrollBy(0, window.innerHeight);", "javascript"
Set finalPrices = .Document.querySelectorAll(".card.js-product-card span.final-price")
Application.Wait Now + TimeSerial(0, 0, 3)
If Timer - t > MAX_WAIT_SEC Then Exit Do
Loop Until finalPrices.Length = products.Length
Set sellers = .Document.querySelectorAll(".card.js-product-card .shop.cf a[title]")
Set availability = .Document.querySelectorAll(".card.js-product-card span.availability")
Set pname = .Document.querySelectorAll(".location-tab")
With ThisWorkbook.Worksheets("TESTINGS")
For i = 0 To sellers.Length - 1
If availability.Item(i).innerText = "¢ìåóç ðáñáëáâÞ / ÐáñÜäïóç 1 Ýùò 3 çìÝñåò" Then
.Cells(j, 4) = sellers.Item(i)
.Cells(j, 5) = finalPrices.Item(i).innerText
.Cells(j, 6) = availability.Item(i).innerText
.Cells(j, 7) = pname.Item(i).innerText
Exit For
End If
wks.Range(Cells(i, 1), Cells(i, 5)).Interior.ColorIndex = 0
'MsgBox ("Link Number " & j & "They left " & MaxNumber - counter)
Application.StatusBar = "Current row " & j & " Progress: " & counter & " of " & MaxNumber & " " & Format(j / MaxNumber, "0%")
Next
End With
wks.Range(Cells(j, 1), Cells(j, 5)).Interior.ColorIndex = 0
Next
Call TransferDataFromColumnE17(ThisWorkbook.Worksheets("TESTINGS"))
.Quit
Set ie = Nothing
End With