scrapy: 'module' object has no attribute 'OP_SINGLE_ECDH_USE'

怎甘沉沦 提交于 2019-12-18 13:36:26

问题


I am new in scrapy, I create a sample project in scrapy and run the project. I got an error

AttributeError: 'module' object has no attribute 'OP_SINGLE_ECDH_USE'

Code:

import scrapy
class DmozSpider(scrapy.Spider):
    name = "dmoz"
    allowed_domains = ["dmoz.org"]
    start_urls = ["https://www.grocerygateway.com"]

    def parse(self, response):
        filename = response.url.split("/")[-2]
        with open(filename, 'wb') as f:
            f.write(response.body)

Thanks in advance


回答1:


I had a similar error, found that pyopenssl was not installed correctly

Simply did

sudo apt-get install libssl-dev

then

pip install pyopenssl --upgrade

scrapy scraped again

linux mint 18.1



来源:https://stackoverflow.com/questions/42573038/scrapy-module-object-has-no-attribute-op-single-ecdh-use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!