1. 程序创建第一步,需要设置这个在setting文件中
# Crawl responsibly by identifying yourself (and your website) on the user-agent
USER_AGENT = 'spiderTest1 (+https://jbk.39.net/)'
本文介绍了一个爬虫项目的初始配置步骤之一:设置USER_AGENT。通过在项目的setting文件中指定USER_AGENT为spiderTest1(https://jbk.39.net/),可以实现负责任地爬取网页,确保网站能够识别爬虫的身份。
1. 程序创建第一步,需要设置这个在setting文件中
# Crawl responsibly by identifying yourself (and your website) on the user-agent
USER_AGENT = 'spiderTest1 (+https://jbk.39.net/)'
1481