Defines two functions used for scrape