This example demonstrates how to lower the risk of being detected by a anti-bot system by running AgentQL in stealth mode.
There are several techniques we use in this script to avoid detection:
- randomize various HTTP headers browser sends to the server. This includes
User-Agent,Accept-Language,Referer, etc. This helps with consecutive requests looking more like they are coming from different users. - randomize browser window size. This is important because some websites track the window size and if it's the same for all requests, it's a sign of a bot.
- randomize timezone and geolocation. This is important because some websites track the timezone and geolocation and if it's the same for all requests, it's a sign of a bot.
- (Optional) use a proxy server. You would need to get a Proxy configuration (host, username, password) separately from an external proxy provider (e.g. NetNut, BrightData or similar)
- Install AgentQL SDK
- If you already have SDK installed, make sure to update to the latest version:
pip3 install agentql --upgrade
- If you already have SDK installed, make sure to update to the latest version:
- Save this python file locally as main.py
- Run the following command from the project's folder:
python3 main.py