Merged detectWeb, doWeb, and scrape function logic
refactoring