Moving query out of scraping dirctory