0

I am trying to write a script to automate a task I'd need to do. So I need this script to check if python is on the /login page and if he is, to enter the username and password for logging in. For username when logging in, in HTML, it is an input type="text" name="username" and for the password it is an input type="password" name="password". I did search and saw that I should use requests but I only saw them executing POST methods and I'm not sure if this is the case here as well.

2 Answers 2

1

Yes selenium works well for this, just to give you some hints. I've done this type of program in the past:

selenium allows you to click on buttons on a website (you can use this to navigate to the login page).

Then it allows you to enter data into text fields (this is using a .send_keys() function which you will use to input your name/password).

Lastly, to actually login you can use the click() function to click on the login button or use send_keys() to "click" enter on the keyboard.

Once you get it working its actually really fun to watch.

Sign up to request clarification or add additional context in comments.

Comments

1

I'd suggest considering using selenium Framework

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.