Hello everyone, I am getting a bizarre *AttributeError: 'Request' object
has no attribute 'method'*
Here is the original code:
class ModularSpider(CrawlSpider):
name = 'modular_spider'
allowed_domains = ['fatsecret.com']
login_url = 'https://www.fatsecret.com/Auth.aspx?pa=s'
start_urls = ['http://www.fatsecret.com/member/dorindam59']
rules = [
# main rule - process members page
Rule(
LinkExtractor(
allow='member\/[^\/\?]+$',
deny='inweb' # deny my own user
),
follow=True,
callback='schedule'
),
]
def schedule(self, response):
print 10 * "$", response.url
import pdb
pdb.set_trace()
r = Request(url=response.url
# callback=users.parse_user,
# dont_filter=True,
# priority=1
)
print 10 * "END"
print r
return
... (code continues)
and here are some investigation I have made
> /Users/thalesfc/Envs/inweb/lib/python2.7/site-packages/scrapy/http/response/__init__.py(34)_get_url()->
> def _get_url(self):
(Pdb) s>
/Users/thalesfc/Envs/inweb/lib/python2.7/site-packages/scrapy/http/response/__init__.py(35)_get_url()->
return self._url
(Pdb) s--Return-->
/Users/thalesfc/Envs/inweb/lib/python2.7/site-packages/scrapy/http/response/__init__.py(35)_get_url()->'http://www.f...onna+Mashburn'->
return self._url
(Pdb) s--Call-->
/Users/thalesfc/Envs/inweb/lib/python2.7/site-packages/scrapy/utils/trackref.py(28)__new__()->
def __new__(cls, *args, **kwargs):
(Pdb) *args*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb) argscls = <class 'scrapy.http.request.Request'>
args = ()
kwargs = {'url': 'http://www.fatsecret.com/member/Donna+Mashburn'}
(Pdb) kwarfs*** NameError: name 'kwarfs' is not defined
(Pdb) kwargs
{'url': 'http://www.fatsecret.com/member/Donna+Mashburn'}
(Pdb) object.__new__(cls)*** AttributeError: 'Request' object has no attribute
'method'
(Pdb) cls<class 'scrapy.http.request.Request'>
I know maybe I just made some basic mistake, but could not find something
related here or on StackOverflow.
*PS: I am running scrapy 1.0.3, and I have already tried to reinstall it.
Anyone have a suggestion?
--
You received this message because you are subscribed to the Google Groups
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.