I am using selenium to download some images for my project!
For downloading images, I use the following command lines:
# Finding elements of images by class name
image_lm = prd.find_element_by_class_name('main')
# The URL to the image
image_url = image_lm.get_attribute('src')
Then, using image_url, I download the images.
The problem is that, after several tries, the class name changes to "main-lazy".
I can manually change the "main" to "main-lazy". is there any way to do it by code.
I am looking for a way to tell the code that either finds the class name of "main-lazy" is the class name of "main" is not available!