0

Currently webscraping soundcloud, using the selenium library. I'm trying to view everything contained in the "sc-visuallyhidden" class but the .text() function only work on find_element and not find_elements. Any suggestions?

search = driver.find_elements_by_css_selector('span.sc-visuallyhidden')
print(search.text)

This returns an error.

1 Answer 1

1

The find_elements method returns a list of elements. You can loop through each of them and print the text

elements = driver.find_elements_by_css_selector('span.sc-visuallyhidden')
for element in elements:
    print(element.text)
Sign up to request clarification or add additional context in comments.

Comments

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.