I'm trying to do the web scraping for a website which is dynamically loaded, I tried everything today to close the popup icon or clicking "No thanks", but it is not working and I am getting error showing in screenshot.
I need to fetch the product name, new and old price and their href image URL in excel.
Option Explicit
Private cd As Selenium.ChromeDriver
Sub Findingelement()
Set cd = New Selenium.ChromeDriver
cd.Start
cd.Get "https://www.westelm.com/shop/furniture/all-living-room/?cm_type=gnav&originsc=furniture"
Dim dismiss As Selenium.WebElement
Dim findby As New Selenium.By
Dim closepopup As Selenium.WebElement
Set dismiss = cd.FindElement(findby.Class("dismiss-overlay-text"))
dismiss.Click
Set closepopup = cd.FindElement(findby.XPath("//div[@class='no-thanks']/a[@class='overlayCloseButton stickyHeaderCloseButton not-into-savings']"))
closepopup.Click
End Sub
