Form Frenzy Problem¶
We found this cool form online at Practice Probs! They let you choose your favourite dog breed and everything! However, they foolishly only let you choose a single dog breed as a favourite. Little do they know, all dogs deserve your love! To make sure we don't leave out any good boys and girls, we need to submit the form once for each listed dog breed.
Your job is to:
- Go to the form.
- Extract all options from the
Your favourite dog breed
field. - Submit the form once for each option, using the form details below for all other fields.
Form Details
Field | Value |
---|---|
Name | John Doe |
j.doe@example.com |
|
Message | All dogs deserve to be loved! |
Image |
Starter code
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://seleniumplayground.practiceprobs.com/contact/")
driver.implicitly_wait(5)
# Your Code here
A few tips
- Use XPath to collect all of the options for different dog breeds.
- XPath has a lot of neat tricks, which can be used to identify individual elements.
- You will have to reload the page after every submission, and refresh all elements you are referencing to (as the Selenium elements expire once the page reloads).