ha-multiscrape icon indicating copy to clipboard operation
ha-multiscrape copied to clipboard

Cannot login to site with multiple buttons in the login form

Open mdotkurmi opened this issue 3 years ago • 1 comments

I am trying to scrape a website that requires login and the login form has two buttons, one for 'Login' and other one for "Forget Password?' image

HA Multiscrape : V6.3.2

Configuration

multiscrape:
- resource: 'https://xxxxx.com/studportal/Student-Home.aspx'
  scan_interval: 3600
  form_submit:
    submit_once: True
    resource: 'https://xxxxx.com/studportal/frmLogin.aspx'
    select: "#aspnetForm"
    input:
      ctl00_ContentPlaceHolder1_txtUserID_Raw: 'user'
      ctl00$ContentPlaceHolder1$txtUserID: 'user'
      ctl00_ContentPlaceHolder1_txtPassword_Raw: 'passwd'
      ctl00$ContentPlaceHolder1$txtPassword: 'passwd'
      ctl00$ContentPlaceHolder1$BnLogin: Login
      #ctl00$ContentPlaceHolder1$BnForgotPassword: ''
  sensor:
    - select: '#studInfoPanelDetailTBL > tr > td'
      name: studentname
  log_response: true

Form submitted by HA Multiscrape: image

Form data in browser on successful login: image

From the log response I see that form is submitted for 'Forget Password' instead of 'Login'. This may be because HA multiscrape also submits ctl00$ContentPlaceHolder1$BnForgotPassword: '' which I think causes the form to submit for Forget password.

Can you suggest how should I configure to remove input ctl00$ContentPlaceHolder1$BnForgotPassword: '' from bring submitted.

mdotkurmi avatar Aug 22 '22 09:08 mdotkurmi

Duplicate of #145

danieldotnl avatar Aug 22 '22 11:08 danieldotnl

This issue is fixed with v6.4.0 where we can remove the inputs not required in submitted form using input_filter in the config.

mdotkurmi avatar Sep 19 '22 09:09 mdotkurmi