Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 432
paradox Avatar asked Dec 03 '22 22:12

paradox


1 Answers

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

like image 150
Stefano SyBorg Avatar answered Dec 11 '22 17:12

Stefano SyBorg