Extract table scraping into a separate function
Use es6-style promises