Interacting With HTML Forms Exercise
00:00
So I hope parsing with Beautiful Soup was fun. Now in this next task, you are going to get to interact with the website using MechanicalSoup
, which also uses Beautiful Soup under the hood and combines it with using the Requests library.
00:12
It makes stuff like submitting forms pretty smooth, I would say. And the task is that it should use this Mechanical Soup library to basically fill a form by providing as a username zeus
and as his password ThunderDude
.
00:27
And you should put that into the login form on that page. You can find it at the same base URL, and then /login
.
00:34 And if the form is submitted, then it redirects you to the Profiles page that you’ve looked at before. So then your program should print out just the title of that page to ensure that you are actually successfully submitted the form and got redirected to this Profiles page.
00:50 Okay, that might sound daunting a bit. You need to interact with a website and do something from your code, but also kind of fun, right? And using Mechanical Soup this is quite straightforward, so give it a shot.
01:02 Check out the tutorial and check out the documentation of Mechanical Soup. Once you got your solution, you can move on to the next video and watch me solve it myself.
Become a Member to join the conversation.