Skip to content

Tabular Troubles Problem

Different dogs come from different places! Corporate just tasked us with retrieving a sorted list of the breeds they are interested in from here. There is a table under the second tab, which we need to sort by country (in ascending order), and then extract all data from. Automate the following:

  1. Go to the page about dog breeds.
  2. Click on the second tab (Table of Different Dog Breeds).
  3. Click the column header for Country of Origin until the column is ascending.
  4. Read out all the table data and write it into a nested Python list.

Starter code

from selenium import webdriver

driver = webdriver.Chrome()
# Your Code here
Expected Result
table_data = [
    '<a href="akita/">Akita Inu</a>',
    'Large breed of dog from northern Japan',
    '<a href="">Wiki: Akita Inu</a>',
    '<img alt="๐Ÿ‡ฏ๐Ÿ‡ต" class="twemoji" src="" title=":flag_jp:">'
    '<a href="labrador_retriever/">Labrador Retriever</a>',
    'British breed of retriever gun dog',
    '<a href="">Wiki: Labrador Retriever</a>',
    '<img alt="๐Ÿ‡ฌ๐Ÿ‡ง" class="twemoji" src="" title=":flag_gb:">'
    '<a href="german_shepherd/">German Shepherd</a>',
    'German breed of working dog of medium to large size',
    '<a href="">Wiki: German Shepherd</a>',
    '<img alt="๐Ÿ‡ฉ๐Ÿ‡ช" class="twemoji" src="" title=":flag_de:">'