问题
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