Headless Photographer Problem¶
Corporate is having trouble retaining users on their website. They have already hired a UI design agency to fix the page, but to get a quote for the work they want an overview of the current website. Thankfully they are all conveniently linked together by a sidebar menu. We need you to click through all sidebar options and take screenshots of the full web page for each option. Automate the following:
- Open the corporate page.
- For each element in the sidebar menu, select the element, then take a screenshot.
- Ensure the screenshot captures the full page content.
The elements for which screenshots are supposed to be taken are labeled
Dog
Dog Breeds
German Shepherd
Labrador Retriever
Akita Inu
Oh, and before I forget, they also want to be able to run the script in a non UI environment. So you will have to run your browser in headless mode!
Starter code
from selenium import webdriver
# modify to make headless
driver = webdriver.Chrome()
driver.get("https://seleniumplayground.practiceprobs.com/dogs/")
driver.implicitly_wait(5)
# Your Code here
driver.close()