So I'm beginner at selenium again....
I have a problem of getting the images in a web page here ANIMEPAGE
So basically here's the console I want to get_attribute
in this image
As you see I'm trying to get the style background image but I can't get it with these lines of code that I've search.
containers = driver.find_elements(by="xpath",value='//div[@class="herald box news"]')
news_link_init = []
news_intro_init = []
news_full_init = []
news_image_init = []
for container in containers:
news_link = container.find_element(by="xpath", value="./div[@class='wrap']//h3/a").get_attribute("href")
news_intro = container.find_element(by="xpath", value="./div[@class='wrap']//span[@class='intro']").text
news_full = container.find_element(by="xpath", value="./div[@class='wrap']//span[@class='full']").text
// AS YOU SEE HERE I"M TRYING TO GET THE ATTRIBUTE STYLE BUT I CAN"T GET IT AND IT GIVES ME ERROR HERE
news_image = container.find_element(by="xpath", value="./div[@class='thumbnail']").get_attribute("style")
news_link_init.append(news_link)
news_intro_init.append(news_intro)
news_full_init.append(news_full)
// Append images
news_image_init.append(news_image)
As you see here in the code I'm trying to get those background-image:url()
but I can't..can anyone help me on these ? Thanks.
Update: This is the always error I have receive based on two answers comment down below