Python Penetration Testing Cookbook
上QQ阅读APP看书,第一时间看更新

Changing the user agent

Many websites use a user agent string to identify the browser and serve it accordingly. As we are using urllib to access the website, it won't recognize this user agent and may behave in strange ways or fail. So, in this case, we could specify the user agent for our requests.