lundi 27 août 2018

Python's web bot to make automated login script

I am trying to understand python's library web bot which can automatically login to a given website. Using their quick demo code, I am able to log in to my google account.

I am trying to login to Microsoft account but its failing on typing the password in the password box. I inspect the password text area:

<input name="passwd" type="password" id="i0118" autocomplete="off" class="form-control" aria-describedby="passwordError loginHeader passwordDesc" aria-required="true" data-bind="
                textInput: passwordTextbox.value,
                hasFocusEx: passwordTextbox.focused,
                placeholder: $placeholderText,
                ariaLabel: str['CT_PWD_STR_PwdTB_AriaLabel'],
                css: { 'has-error': passwordTextbox.error }" placeholder="Password" aria-label="Enter password">

This is the code snippet:

web.click('Next' , tag='span')
web.type('<mypassword' , into='passwd')
web.click('Sign in' , tag='span')

As the inspect contains autocomplete=off, I am thinking this is the reason it might not be able to enter the password in the password area.

Is it true that web bot will not work in case of autocomplete=off. Is there any other library which I can use to do this task. How can I resolve this?

Thanks




Aucun commentaire:

Enregistrer un commentaire