Issue
I am trying to get the image link from this page.
def save_score(self):
element_lst = self.driver.find_elements_by_class_name('ingredient-score score-popup')
score_lst = [element.get_attribute('src') for element in element_lst]
return len(element_lst)
But it seems like selenium can't get the elements when I am finding it by the class name. In this table I have 8 image links that I want to scrape. Is there any way around to achieve this? Maybe using Xpath?
Solution
when you're using class as Selector we don't use space between the values, instead of "ingredient-score score-popup" try with "ingredient-score.score-popup". I leave this reference page
Answered By - Nilson Nieto
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.