I don't understand if I use this methodcould you work the scrape using XMLHTTP instead
Sub HeadlessSelenium()
Dim PJSD As Selenium.PhantomJSDriver
Dim strHTML As String
' Instantiate Selenium through the PhantomJS Driver
Set PJSD = New Selenium.PhantomJSDriver
PJSD.Start
' Navigate to the URL
PJSD.Get "https://www.inserturlhere.com"
' Extract the HTML code of the website
strHTML = PJSD.PageSource
' Print the HTML code to the Immediate Window
Debug.Print strHTML
End Sub
@Dan_WCan you share your code, please? It's not easy to help you otherwise. Did you try the PhantomJSDriver? XMLHTTP?
Sub tesselenium()
Dim ch As New Selenium.ChromeDriver
Dim URLNAME As String
Dim sht As Worksheet
Dim price As String
Dim EndRow As Long, i As Long 'ADDED
Set sht = ActiveSheet
EndRow = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
For i = 3 To EndRow
URLNAME = Cells(i, 1).Value
With ch
.AddArgument "--headless"
.Get URLNAME
'This is Url "https://www.tokopedia.com/petanidaun/foliage-premium-plant-food-khusus-tanaman-hias-daun
End With
ch.Wait 1000
price = ch.FindElementByClass("price").Text
Sheet3.Cells(i, 4) = price
ch.Quit
Set ch = Nothing
Application.StatusBar = ""
On Error GoTo 0
Next i
End Sub
Sub HeadlessSelenium_CD()
Dim CD As Selenium.ChromeDriver
Dim strHTML As String
' Instantiate Selenium through the ChromeDriver
Set CD = New Selenium.ChromeDriver
' Run Selenium in Headless mode
CD.AddArgument "--headless"
CD.Start
' Navigate to the URL
CD.Get "https://www.tokopedia.com/petanidaun/foliage-premium-plant-food-khusus-tanaman-hias-daun"
' Extract the HTML code of the website
strHTML = CD.PageSource
' Print the HTML code to the Immediate Window
Debug.Print strHTML
CD.Close
Set CD = Nothing
End Sub
<html><head>
<title>Access Denied</title>
</head><body>
<h1>Access Denied</h1>
You don't have permission to access "http://www.tokopedia.com/petanidaun/foliage-premium-plant-food-khusus-tanaman-hias-daun" on this server.<p></p></body></html>