为了账号安全,请及时绑定邮箱和手机立即绑定

Scrapy异常-exceptions.AttributeError:'unicode'对象没有属性

Scrapy异常-exceptions.AttributeError:'unicode'对象没有属性

ibeautiful 2021-04-01 10:11:45
我已经写了一个蜘蛛,但是每当我运行这个蜘蛛时,我都会得到这个错误:Traceback (most recent call last):  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/base.py", line 824, in runUntilCurrent    call.func(*call.args, **call.kw)  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/task.py", line 607, in _tick    taskObj._oneWorkUnit()  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/task.py", line 484, in _oneWorkUnit    result = next(self._iterator)  File "/usr/local/lib/python2.7/dist-packages/scrapy/utils/defer.py", line 57, in <genexpr>    work = (callable(elem, *args, **named) for elem in iterable)--- <exception caught here> ---  File "/usr/local/lib/python2.7/dist-packages/scrapy/utils/defer.py", line 96, in iter_errback    yield it.next()  File "/usr/local/lib/python2.7/dist-packages/scrapy/contrib/spidermiddleware/offsite.py", line 28, in process_spider_output    for x in result:  File "/usr/local/lib/python2.7/dist-packages/scrapy/contrib/spidermiddleware/referer.py", line 22, in <genexpr>    return (_set_referer(r) for r in result or ())  File "/usr/local/lib/python2.7/dist-packages/scrapy/contrib/spidermiddleware/urllength.py", line 33, in <genexpr>    return (r for r in result or () if _filter(r))  File "/usr/local/lib/python2.7/dist-packages/scrapy/contrib/spidermiddleware/depth.py", line 50, in <genexpr>    return (r for r in result or () if _filter(r))  File "/home/vaibhav/scrapyprog/comparison/eScraperInterface/eScraper/spiders/streetstylestoreSpider.py", line 38, in parse    item['productURL'] = site.select('.//a/@href').extract()exceptions.AttributeError: 'unicode' object has no attribute 'select'
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 257 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信