如何用pycharm编写scrapy项目:[8]user-agent
1、第一步:首先我们找到我们的谷歌浏览器,在搜索框中搜索about,选择version。
![如何用pycharm编写scrapy项目:[8]user-agent](https://exp-picture.cdn.bcebos.com/1570c1b6326c576634f70ae6a4632385e136618d.jpg)
2、第二步:进入谷歌浏览器的version界面,我们找到用户代理选项,这个就是user-agent,我们复制它。
![如何用pycharm编写scrapy项目:[8]user-agent](https://exp-picture.cdn.bcebos.com/6002c9d4483104eb489f57ba092b74ee1d324e8d.jpg)
3、第三步:我们打开我们的pycharm,找到我们的scrapy项目文件中的settings,点击进入。
![如何用pycharm编写scrapy项目:[8]user-agent](https://exp-picture.cdn.bcebos.com/4a6d48ee7b7f860eb24ded4177f5ee0d3bcebe8d.jpg)
4、第四步:我们在settings中将user-agent设置为我们刚刚复制的内容。
![如何用pycharm编写scrapy项目:[8]user-agent](https://exp-picture.cdn.bcebos.com/bff8683e21c2bbd63fe8655d116186254093ae8d.jpg)
5、第五步:最后,我们运行爬虫,我们可以看到,user-agent设置好了。快来实践一下吧。
![如何用pycharm编写scrapy项目:[8]user-agent](https://exp-picture.cdn.bcebos.com/0cdb2f0e1799e92a56804af5e1fec314f0c5a08d.jpg)