python selenium find button to click

Viewed 50

The html context is like:

<div role="button" class="quantumWizButtonEl quantumWizButtonPaperbuttonEl quantumWizButtonPaperbuttonFlat quantumWizButtonPaperbuttonFlatColored quantumWizButtonPaperbutton2El2 quantumWizDialogPaperdialogDialogButton exportDefaultDialogButton freebirdThemedFlatButton isUndragged" jscontroller="VXdfxd" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;" jsshadow="" jsname="LgbsSe" aria-disabled="false" tabindex="0" data-id="EBS5u" autofocus=""><div class="quantumWizButtonPaperbuttonRipple exportInk" jsname="ksKsZd"></div><div class="quantumWizButtonPaperbuttonFocusOverlay exportOverlay"></div><span jsslot="" class="quantumWizButtonPaperbuttonContent"><span class="quantumWizButtonPaperbuttonLabel exportLabel">登录</span></span></div>

The complete html code is here

enter image description here

I want to click the button named 登录 by

driver.find_element_by_link_text("登录").click()

The error is:

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"link text","selector":"登录"}
0 Answers
Related