Fixing KeyError that arises 'a' tags are missing hrefs

Though I have no idea why this happens when a page is retrieved by script and doesn't seem to in the browser's source view.