【问题标题】:ssl handshake failure error in scrapy pythonscrapy python中的ssl握手失败错误
【发布时间】:2012-07-19 12:19:51
【问题描述】:

目前我正在研究scrapy,下面是我的spider.py代码

class Example(BaseSpider):
    name = "example"
    allowed_domains = {"http://www.example.com"}


    start_urls = [
        "https://www.example.com/rwjhamilton/index.cfm?&ijobcatid=100&ijobrowset=1&cjobattr1=All&template=dsp_job_list.cfm"
    ]


    def parse(self, response):
        hxs = HtmlXPathSelector(response)
        href_tags = hxs.select('//font[@class="bannertext"]/u/a/@href').extract()
        print href_tags,">>>>>>>>>>>>>>>>"

结果:

2012-07-19 17:32:20+0530 [example] ERROR: Error downloading <GET https://www.example.com/rwjhamilton/index.cfm?&ijobcatid=100&ijobrowset=1&cjobattr1=All&template=dsp_job_list.cfm>: [('SSL routines', 'SSL23_READ', 'ssl handshake failure')]

这个错误对scrapy来说似乎很新,我真的不知道如何解决这个问题,谁能告诉我为什么会出现这个错误以及如何解决它。 其实我正在尝试收集上面网址中的href标签,似乎总共有40个href标签

有时响应正在下载,有时正在显示

2012-07-19 17:39:15+0530 [example] DEBUG: Retrying <GET https://www.example.com/rwjhamilton/index.cfm?&ijobcatid=100&ijobrowset=1&cjobattr1=All&template=dsp_job_list.cfm> (failed 1 times): Connection to the other side was lost in a non-clean fashion

请告诉我如何解决这个问题。 提前谢谢.....

【问题讨论】:

    标签: python url response scrapy


    【解决方案1】:

    我认为这个问题已经在这里解决了

    https://github.com/scrapy/scrapy/pull/186

    0.15scrapy 发布后已修复

    【讨论】:

      【解决方案2】:

      我也遇到了这个错误:

      2013-03-07 06:58:01+0800 [CrawlSpider] ERROR: Error downloading <GET a_website_url>: Connection to the other side was lost in a non-clean fashion.
      

      我的scrapy版本是0.16.3。原因是它是我所在国家/地区的受限网站。

      【讨论】:

        猜你喜欢
        • 2014-01-14
        • 2012-06-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-01-20
        • 1970-01-01
        • 2015-11-05
        • 1970-01-01
        相关资源
        最近更新 更多