Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usatoday.py is raising an exception and failing to parse many pages #3

Open
pmyteh opened this issue Jan 20, 2020 · 0 comments
Open

Comments

@pmyteh
Copy link
Owner

pmyteh commented Jan 20, 2020

2020-01-17 11:41:01 [scrapy.core.scraper] ERROR: Spider error processing <GET https://www.usatoday.com/story/sports/sports-betting/2020/01/17/anaheim-ducks-at-carolina-hurricanes-odds-picks-and-best-bets/41014307/> (referer: https://www.usatoday.com/news-sitemap.xml)
Traceback (most recent call last):
  File "/home/euler/miniconda3/envs/pytorch/lib/python3.7/site-packages/scrapy/loader/processors.py", line 59, in __call__
    value = func(value)
  File "/home/euler/miniconda3/envs/pytorch/lib/python3.7/site-packages/scrapy/loader/processors.py", line 107, in __call__
    return self.separator.join(values)
  File "/mnt/data1/NLP/RISJbot-master/RISJbot/loaders.py", line 42, in _strip_strl
    yield s.strip()
AttributeError: 'int' object has no attribute 'strip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/euler/miniconda3/envs/pytorch/lib/python3.7/site-packages/scrapy/loader/__init__.py", line 159, in _process_input_value
    return proc(value)
  File "/home/euler/miniconda3/envs/pytorch/lib/python3.7/site-packages/scrapy/loader/processors.py", line 63, in __call__
    (str(func), value, type(e).__name__, str(e)))
ValueError: Error in Compose with <scrapy.loader.processors.Join object at 0x7f4bf64d1dd0> value=<generator object _strip_strl at 0x7f4be104a8d0> error='AttributeError: 'int' object has no attribute 'strip''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/euler/miniconda3/envs/pytorch/lib/python3.7/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/mnt/data1/NLP/RISJbot-master/RISJbot/spiders/newssitemapspider.py", line 29, in parse
    return self.parse_page(response)
  File "/mnt/data1/NLP/RISJbot-master/RISJbot/spiders/us/usatoday.py", line 60, in parse_page
    l.add_schemaorg(response)
  File "/mnt/data1/NLP/RISJbot-master/RISJbot/loaders.py", line 171, in add_schemaorg
    rdfa=False)
  File "/mnt/data1/NLP/RISJbot-master/RISJbot/loaders.py", line 184, in add_schemaorg_mde
    self.add_value('keywords',     data.get('keywords'))
  File "/home/euler/miniconda3/envs/pytorch/lib/python3.7/site-packages/scrapy/loader/__init__.py", line 78, in add_value
    self._add_value(field_name, value)
  File "/home/euler/miniconda3/envs/pytorch/lib/python3.7/site-packages/scrapy/loader/__init__.py", line 92, in _add_value
    processed_value = self._process_input_value(field_name, value)
  File "/home/euler/miniconda3/envs/pytorch/lib/python3.7/site-packages/scrapy/loader/__init__.py", line 164, in _process_input_value
    value, type(e).__name__, str(e)))
ValueError: Error with input processor Compose: field='keywords' value=[2] error='ValueError: Error in Compose with <scrapy.loader.processors.Join object at 0x7f4bf64d1dd0> value=<generator object _strip_strl at 0x7f4be104a8d0> error='AttributeError: 'int' object has no attribute 'strip'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant