How do I fill this form using mechanicalsoup or any other python library?

320 Views Asked by At
  <div id='credentials' class='loggedout'>
      <input name='username' placeholder='Username' type='text'  id='username' size='30' maxlength='60'>
      <input name='password' placeholder='Password' type='password' id='password' size='30' autocomplete='off' maxlength='60' onfocus='if(this.value=="Password")this.value="";'>
  </div>

I have to fill username and Password in this snippet. I use to use mechanicalsoup where this used to work:

browser.select_form(CSS Selector) and then insert individual values as

browser['username'] = umame

browser['Password'] = pass

But there no form tag in this so I am not able do this. Is there any way to achieve this.

Any help or advice is hearty appreciated!! Thanks

0

There are 0 best solutions below