I am using a cloud Splash instance from ScrapingHub. I am trying to do a simple request using the Scrapy-Splash library and I keep getting the error:
@attr.s(hash=False, repr=False, eq=False)
TypeError: attrs() got an unexpected keyword argument 'eq'
Any ideas/clues about why the error is showing up would be much appreciated.
The code I'm using looks like this (using Python 3.6 and Scrapy v 2.1.0):
import scrapy
from scrapy_splash import SplashRequest
class MySpider(scrapy.Spider):
start_urls = ['https://www.sportsgirl.com.au', 'http://maryons.com.au']
def start_requests(self):
for url in self.start_urls:
yield SplashRequest(url, self.parse, args={'wait': 0.5})
def parse(self, response):
print(response)
MySpider().start_requests()
and settings.py has the following values:
DOWNLOADER_MIDDLEWARES = {
'scrapy_splash.SplashCookiesMiddleware': 723,
'scrapy_splash.SplashMiddleware': 725,
'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware': 810,
}
SPIDER_MIDDLEWARES = {
'scrapy_splash.SplashDeduplicateArgsMiddleware': 100,
}
SPLASH_URL = 'https://my-splash-url.scrapinghub.com'
Bookmark this question. Show activity on this post. What i did wrong. Show activity on this post. attrs is not an argument to the field, it's an argument to the widget. Note that some browsers don't allow styling of the file input. Show activity on this post.
So, update attrs in the dephell's environment, and everything will be ok I understand it's not backwards compatible, I just want the version constraint updated so that pip correctly pulls in attrs>=19.2.
You have an old / unsupported version of attrs installed on your machine. You can remove it with pip3 uninstall attrs or pip uninstall attrs. Sorry, something went wrong.
The error is coming from the Twisted library, which is a dependency of Scrapy.
It looks like it's fixed in the latest version. If you run
pip install --upgrade twisted
you should be fine!
I also had to upgrade attrs in order to make the error message disappear.
pip3 install attrs==19.2.0 -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
I found this on: https://www.programmersought.com/article/61587312947
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With