How to rotate proxies in Python with requests, Scrapy and Selenium: short code that runs, a retry loop, gateway rotation and the mistake that leaks your IP.