0

I'm trying to scrape a site with Selenium in Python. I have found this question answered only in html: I need to select some elements with class name

<span ng-if="evento.quota>=100" class="ng-binding ng-scope">1,14</span>

But on the same page I also have elements with class name

<th ng-repeat="(key, eventoHeader) in manif.eventi" class="text-centerSport ng-binding ng-scope"     ng-class="{'different-color' : checkDifferentColor($index, manif.eventi)}">
                                    X2
                                </th>

And since I need to select all of those elements present on the page, I can't use XPATH. Is there a way to say to Selenium that I only want those element with that specific class name?

1 Answer 1

1

Why can't you use XPATH?

find_elements_by_xpath

will return a list of elements.

Sign up to request clarification or add additional context in comments.

2 Comments

but they don't have the same xpath
//span[@class='ng-binding ng-scope'] for your example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.