Python Forum
robobrowser, answer authentication-challenge after login
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
robobrowser, answer authentication-challenge after login
#1
I'm really new to python programming. I'm working on automation of a web-browser. I started with selenium, but found it to be really slow for what I need.

I'm working on a code that can Login to a webpage and fill out few text-boxes and click on few buttons. I finally achieved the 1st part. My program can finally sign to the webpage using the robobrowser.

import re
from robobrowser import RoboBrowser
browser = RoboBrowser()
login_url = 'https://webbroker.td.com/waw/idp/login.htm?execution=e1s1'
browser.open(login_url)
form = browser.get_form(id="login")
form["login:AccessCard"].value = "****"
form["login:Webpassword"].value = "****"
browser.submit_form(form)
As soon as I login to this webpage, it is asking me to answer an authentication question.

<div class="td-layout-row td-margin-top-medium">
<div class="td-layout-column td-layout-grid15"><label class="questionText" for="MFAChallengeForm:answer" id="MFAChallengeForm:question">
What is your favourite TV show?</label></div>
</div>
<div class="td-layout-row">
<div class="td-layout-column td-layout-grid7"><input autocomplete="off" id="MFAChallengeForm:answer" maxlength="25" name="MFAChallengeForm:answer" onkeydown="trapEnter(event,'MFAChallengeForm',id,'next')" size="25" type="password" value=""/></div>
</div>
How do I carry on form here? I need to enter and submit my authentication answer in order to proceed. In selenium, it would be something like this.

AQ = driver.find_element_by_id("MFAChallengeForm:answer")
AQ.send_keys("******")
*Click Submit*
how would I do it in robobrowser/lxml/beautifulsoup? I need to submit my answer(while sill being logged in). Most example that I have seen only scrape text from one specific web page. However is it possible to log in and keep on surfing the web?

Thank you in advance.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  saml2 idp sso authentication tiagome 1 2,086 Apr-08-2022, 02:38 PM
Last Post: snippsat
  RoboBrowser error Pythenx 2 4,072 Mar-23-2019, 12:49 PM
Last Post: metulburr
  Python Challenge ~ Help Takshan 4 4,046 Jul-07-2017, 11:01 AM
Last Post: Takshan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020