Issue
Scraping data from a website in which a lot of text was hidden under the "see more" tab.
Via selenium
click all such buttons and then scrape using beautifulsoup
. However, a few of the buttons have extra whitespaces in their HTML tags. copying and pasting them to browser.find_element_by_class_name('')
always yields an error.
class="pv-profile-section__see-more-inline pv-profile-section__text-truncate-toggle
artdeco-button artdeco-button--tertiary artdeco-button--muted"
Notice how there's extra white space behind artdeco, could anyone help me with this please? Manually adding those spaces or putting them in same line doesn't do anything.
Solution
Note: You won't be able to pass multiple classnames as argument through find_element_by_class_name()
cause it only accept a single classname
To find element by multiple classnames try to use css-selectors:
browser.find_element_by_css_selector(".firstClassName.secondClassName")
Answered By - HedgeHog
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.