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

IndexError: list index out of range #7

Open
ComplicatedPhenomenon opened this issue Nov 9, 2018 · 1 comment
Open

IndexError: list index out of range #7

ComplicatedPhenomenon opened this issue Nov 9, 2018 · 1 comment

Comments

@ComplicatedPhenomenon
Copy link

Hi, @chenjiandongx
I couldn't solve the problem as below via google it

$ scrapy crawl stackoverflow -o a.csv
...
2018-11-09 20:01:37 [scrapy.core.scraper] ERROR: Spider error processing <GET https://stackoverflow.com/questions?page=3&sort=votes&pagesize=50> (referer: None)
Traceback (most recent call last):
  File "~/anaconda3/lib/python3.6/site-packages/scrapy/utils/defer.py", line 102, in iter_errback
    yield next(it)
  File "~/anaconda3/lib/python3.6/site-packages/scrapy/spidermiddlewares/offsite.py", line 30, in process_spider_output
    for x in result:
  File "~/anaconda3/lib/python3.6/site-packages/scrapy/spidermiddlewares/referer.py", line 339, in <genexpr>
    return (_set_referer(r) for r in result or ())
  File "~/anaconda3/lib/python3.6/site-packages/scrapy/spidermiddlewares/urllength.py", line 37, in <genexpr>
    return (r for r in result or () if _filter(r))
  File "~/anaconda3/lib/python3.6/site-packages/scrapy/spidermiddlewares/depth.py", line 58, in <genexpr>
    return (r for r in result or () if _filter(r))
  File "~/stackoverflow-spider/stackoverflow/spiders/stackoverflow_spider.py", line 48, in parse
    sel.xpath('div[1]/div[3]/@title').extract()).split()[0].replace(",", "")
IndexError: list index out of range

Thank you!

@chenjiandongx
Copy link
Owner

Hi, may be Stack overflow has changed the html page structure.So the code raise ex now

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

2 participants