Fixed scraping algorithm logic