Fix keyerror exception when scraping input