# Iterate through each anchor in our list of anchor
for element in anchor_on_page:
    
    # If the element does not have the keyword we are looking for we are going to skip it
    if element.get('href') == None:
        continue
    
    # Create another nested dictionary for each link under "href". 
    # The nested dictionary is used to store another other meta data/ information that is also inside the anchor
    linkDictionary[element.get('href')] = {}
    
    # In the entry for the nested dictionary we are going to assign the keyword "link" with the URL link
    linkDictionary[element.get('href')]['link'] = str(element.get('href'))
    
    # Grab any string attached to the anchor. Setting all that have none present to 'null'
    if (element.string == None):
        linkDictionary[element.get('href')]['string'] = 'null'
    else:
        linkDictionary[element.get('href')]['string'] = element.string
    
    # This next part is dependant on the url you are using. In this example, the Wikipedia page sometimes uses the 
    # word "title" inside their anchor. Therefore in the cases that it does appear I want to save it, if it doesn't
    # exist then I want to enter "null" for the value. 
    if (element.get('title')) == None:
        linkDictionary[element.get('href')]['title'] = 'null'
    else:
        linkDictionary[element.get('href')]['title'] = element.get('title')