I need to scrape size chart image in a website. The image is placed inside a popup. I am using Selenium, Python to trigger the a href and scrape the data. I have attached my code for the reference.
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import time
from time import sleep
url = 'https://www.macys.com/shop/product/jessica-howard-side-twist-sheath-dress?ID=11329706&CategoryID=5449'
driver = webdriver.Firefox()
driver.get(url)
#sizechart_popup = driver.find_elements_by_class_name('sc-link')
sizechart_popup = WebDriverWait(driver, 50).until(EC.element_to_be_clickable((By.XPATH, './/*[@class="sc-link"]'))).click()
print (sizechart_popup)
# Sleep of 10 seconds irrespective of whether element is present or not
time.sleep(50)
# Free up the resources
driver.close()
Please help to rectify this.
