5 Guidelines for Web Scraping
I've done a fair share of web scraping to gather sports data, and some automated testing and validation. I also happen to sit next to the team that manages application security and bot detection at work. I have a few guidelines for responsibly scraping, avoiding the dreaded block/sinkhole, and being a good netizen. I've generally used Python, so I name the libraries I use there, but it's not too hard to find the equivalent in your language of choice. 1. Set your headers correctly. Headers are the easiest way to detect a bot. If you don't change your headers, you literally tell the web server that you're using headless Chrome or Python Requests. A large amount of traffic from a single IP with suspect looking headers is a quick route to the block list, or at least a partial block or request sinkhole. My strategy has always been to get the headers from hitting the site from my browser. In Chrome, you can get that information by viewing your req...