Click here to Skip to main content
15,881,092 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Patron,

I am trying to find button With text "Connect" using
connect_buttons = firefox.find_elements_by_link_text ('Connect')
#But firefox is not able to find button.

<button aria-label="Connect with ABC" class="search-result__actions--primary button-secondary-medium m5" data-ember-action="" data-ember-action-1510="1510">Connect</button>

<button aria-label="Connect with DEF" class="search-result__actions--primary button-secondary-medium m5" data-ember-action="" data-ember-action-1467="1467">Invite Sent !</button>

Even i have tried using following mode too
firefox.find_elements_by_xpath("//*[contains(text(), 'Connect')]")
# Not accurate results

firefox.find_elements_by_css_selector('.search-result__actions--primary.button-secondary-medium.m5');
# return all button with same css even which doesn't have text "Connect".

Please suggest.

What I have tried:

connect_buttons = firefox.find_elements_by_link_text ('Connect');
connect_buttons = firefox.find_elements_by_xpath("//*[contains(text(), 'Connect')]")
connect_buttons = firefox.find_elements_by_css_selector('.search-result__actions--primary.button-secondary-medium.m5');
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900