python callback failed_python 爬虫开发出现问题 failed to retrieve ALPN result该如何处理

python 爬虫开发出现问题 failed to retrieve ALPN result该如何处理?

有人有遇到过类似问题吗?

代码完全复制:https://binux.blog/2015/01/py…

开发环境:win7 64 python3.5

工具:pyspider

代码:

#!/usr/bin/env python

# -*- encoding: utf-8 -*-

# Created on 2015-01-04 10:42:01

# Project: tutorial_douban_movie

import re

from pyspider.libs.base_handler import *

class Handler(BaseHandler):

"""

This is a sample script for: pyspider 爬虫教程(一):HTML 和 CSS 选择器

http://blog.binux.me/2015/01/pyspider-tutorial-level-1-html-and-css-selector/

"""

@every(minutes=24 * 60)

def on_start(self):

self.crawl('http://movie.douban.com/tag/', callback=self.index_page)

@config(age=24 * 60 * 60)

def index_page(self, response):

for each in response.doc('a[href^="http"]').items():

if re.match("http://movie.douban.com/tag/\w+", each.attr.href, re.U):

self.crawl(each.attr.href, callback=self.list_page)

@config(age=10*24*60*60, priority=2)

def list_page(self, response):

for each in response.doc('HTML>BODY>DIV#wrapper>DIV#content>DIV.grid-16-8.clearfix>DIV.article>DIV>TABLE TR.item>TD>DIV.pl2>A').items():

self.crawl(each.attr.href, priority=9, callback=self.detail_page)

# 翻页

for each in response.doc('HTML>BODY>DIV#wrapper>DIV#content>DIV.grid-16-8.clearfix>DIV.article>DIV.paginator>A').items():

self.crawl(each.attr.href, callback=self.list_page)

@config(priority=3)

def detail_page(self, response):

return {

"url": response.url,

"title": response.doc('HTML>BODY>DIV#wrapper>DIV#content>H1>SPAN').text(),

"rating": response.doc('HTML>BODY>DIV#wrapper>DIV#content>DIV.grid-16-8.clearfix>DIV.article>DIV.indent.clearfix>DIV.subjectwrap.clearfix>DIV#interest_sectl>DIV.rating_wrap.clearbox>P.rating_self.clearfix>STRONG.ll.rating_num').text(),

"导演": [x.text() for x in response.doc('a[rel="v:directedBy"]').items()],

}

错误提示:

[E 170113 16:47:13 base_handler:195] HTTP 599: schannel: failed to retrieve ALPN result

Traceback (most recent call last):

File "d:\anaconda3\lib\site-packages\pyspider\libs\base_handler.py", line 188, in run_task

result = self._run_task(task, response)

File "d:\anaconda3\lib\site-packages\pyspider\libs\base_handler.py", line 167, in _run_task

response.raise_for_status()

File "d:\anaconda3\lib\site-packages\pyspider\libs\response.py", line 190, in raise_for_status

raise http_error

requests.exceptions.HTTPError: HTTP 599: schannel: failed to retrieve ALPN result

pyspider没有使用过,但这个问题在GitHub上都有提问过

HTTP 599: schannel: failed to retrieve ALPN result

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值