Input: ./script email password url
Output: Cookies after login
A script is to be made in nodejs/python for ex. puppeteer or bs4 to automate login based on css selectors. The script should look for all css selectors on a website and input username and password into input fields. If a cookie is generated on successful login, it should be returned back via [login to view URL] or print.
Cases to look for:
1. Each URL will have 2 inputs (username and password) and 1 submit button. Goal is to enter values specified in the arguments into these inputs and click on submit button which will generate the cookies.
-> Make array for all elements / css selectors within application
-> Find 1 input with keywords email/user or any regex to get that
-> Find 1 input with keywords pass/password/other regex
-> Find submit button selector and click it (<button type=submit>)
-> If new cookie set then stop and return back set of cookies
-> If not select any 2 elements from array and put in inputs and click on submit
-> If no cookie found repeat for other elements in array.
For example in the screenshot,
automate login via entering asdasd(at)[login to view URL] in email and asdasd in password and click on login and return back cookies after successful login