爬取豆瓣电影top250,出现以下报错:

2018-08-11 22:02:16 [scrapy.core.engine] INFO: Spider opened
2018-08-11 22:02:16 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2018-08-11 22:02:16 [scrapy.extensions.telnet] DEBUG: Telnet console listening on 127.0.0.1:6023
2018-08-11 22:02:17 [scrapy.core.engine] DEBUG: Crawled (403) <GET https://movie.douban.com/robots.txt> (referer: None)
2018-08-11 22:02:17 [scrapy.core.engine] DEBUG: Crawled (403) <GET https://movie.douban.com/top250> (referer: None)
2018-08-11 22:02:17 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <403 https://movie.douban.com/top250>: HTTP status code is not handled or not
allowed
2018-08-11 22:02:17 [scrapy.core.engine] INFO: Closing spider (finished)

防止反爬机制,伪装user_agent

【1】打开豆瓣top250 :  https://movie.douban.com/top250

【2】F12 打开控制台->刷新页面 ->Network->请求头部找到 User-Agent

在scrapy项目中找到settings.py的  USER_AGENT = ' '  (把注释去掉,加以下内容)

USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3493.3 Safari/537.36'

重新执行即可

scrapy crawl douban_spider

INFO: Ignoring response <403 https://movie.douban.com/top250>: HTTP status code is not handled or not allowed的更多相关文章

  1. python scrapy 报错 DEBUG: Ignoring response 403

    DEBUG: Ignoring response <403 http://movie.douban.com/top250>: HTTP status code is not handled ...

  2. docker 1.12.3版本搭建私有仓库,上传镜像报错:server gave HTTP response to HTTPS client”

    系统环境:centos7 docker版本: 1.12.3(注意版本,可能存在不同版本设置不同的情况) docker registry版本:2.4.1 问题: 成功安装docker registry, ...

  3. http: server gave HTTP response to HTTPS client & Get https://192.168.2.119/v2/: dial tcp 192.168.2.119:443: getsockopt: connection refused

    http: server gave HTTP response to HTTPS client 出现这问题的原因是:Docker自从1.3.X之后docker registry交互默认使用的是HTTP ...

  4. [原]Docker-issue(2) http: server gave HTTP response to HTTPS client

    系统环境 查看 文章末尾 附录 问题点:新建local registry后,push新的image到local registry  未能成功,并报错误: The push refers to repo ...

  5. docker local registry server gave HTTP response to HTTPS client

    server gave HTTP response to HTTPS client报错是在insecure_registry中加入了http前缀,如果本地registry不是https的 就不要加任何 ...

  6. docker registry push错误“server gave HTTP response to HTTPS client”

    系统环境:centos7 docker版本: 1.12.3(注意版本,可能存在不同版本设置不同的情况) docker registry版本:2.4.1 问题: 成功安装docker registry, ...

  7. (七)VMware Harbor 问题:Get https://192.168.3.135:8088/v2/: http:server gave HTTP response to HTTPS client

    (一)问题描述 登陆时,报错 docker Get https://192.168.3.135:8088/v2/: http:server gave HTTP response to HTTPS cl ...

  8. 【解决】http: server gave HTTP response to HTTPS client

    [问题]上传镜像到私有仓库时报错 $ docker push xxx.xxx.xxx.xxx:5000/java-8 The push refers to repository [xxx.xxx.xx ...

  9. springMVC or response redirect https

    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> < ...

随机推荐

  1. 从dataset表中获取某一列的所有值方法

    原文发布时间为:2008-07-31 -- 来源于本人的百度文章 [由搬家工具导入] 可以datarow遍历所有行即可,如下:pubauthor这个表中的au_lname的所有值加到listbox上面 ...

  2. MySQL实现了四种通信协议

    原文链接:http://blog.csdn.net/yangling132/article/details/50932705[侵删] TCP/IP协议,通常我们通过来连接MySQL,各种主要编程语言都 ...

  3. Android UI设计--半透明效果对话框及activity(可做遮罩层)

    下面是style的一些属性及其解释 <style name="dialog_translucent" parent="@android:style/Theme.Di ...

  4. 使用javaconfig方式配置spring工程的单元测试

    添加@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {MoveModelSpringTestConfig ...

  5. C# 编程中的堆栈(Stack)和队列(Queue)

    一.什么是堆?(Heap)      堆是无序的,是一片不连续的内存域,由用户自己来控制和释放,如果用户自己不释放的话,当内存达到一定的特定值时,通过垃圾回收器(GC)来回收.      是程序运行期 ...

  6. H5页面基于iScroll.js插件实现下拉刷新,上拉加载更多

    前言 在我之前的项目中,页面总是干巴巴的,用户的体验不是特别完美,我也是一直觉得把设计师给到的psd做出来就好,很少考虑用户的感受.我喜欢看不同的App,操作每个步骤,观赏每个能和我互动的交互设计效果 ...

  7. Idea基本讲解、常用配置以及快捷键设置

    IDEA官网学习文档:https://www.jetbrains.com/idea/documentation/ IDEA官网入门教程:https://www.jetbrains.com/help/i ...

  8. 关于FileZilla Server的安装问题

    网上很多FileZilla Server教程到最后一步在本机上测试访问成功就没了,实际上还是不完整的,一般情况下外网还是访问不了,外网访问同样很重要. 可能有点童鞋会说安装的时候防火墙提示的时候我也点 ...

  9. 读取编码器信息Python2.7和Python3.3版本差异及解决,一次订阅多次调用callback的解决

    1. Python3.3以字节类型返回编码器信息,b'...',BUF: b'\xc3KOO\x00OO\x00OO\x00OO\x00OO\x00\x03\x00\x00\x00\x00\x99R\ ...

  10. Java中的Copy-on-Write容器 & ConcurrentHashMap & HashTable比较

    参考这篇文章:Link 从JDK1.5开始Java并发包里提供了两个使用CopyOnWrite机制实现的并发容器,它们是CopyOnWriteArrayList和CopyOnWriteArraySet ...