rmayf / CollegeFootballChallenge

PAC-12 Fantasy Football
3 stars 0 forks source link

Not all stats being scraped #35

Closed rmayf closed 8 years ago

rmayf commented 8 years ago

For example in week 1:

rmayf commented 8 years ago

Error when scraping Oregons' game

home@ff:~/CollegeFootballChallenge/cfbScraper$ scrapy crawl boxscore -a gameId=400869096
2016-09-05 05:57:07 [scrapy] INFO: Scrapy 1.0.3 started (bot: cfbScraper)
2016-09-05 05:57:07 [scrapy] INFO: Optional features available: ssl, http11
2016-09-05 05:57:07 [scrapy] INFO: Overridden settings: {'NEWSPIDER_MODULE': 'cfbScraper.spiders', 'SPIDER_MODULES': ['cfbScraper.spiders'], 'BOT_NAME': 'cfbScraper'}
2016-09-05 05:57:08 [scrapy] INFO: Enabled extensions: CloseSpider, TelnetConsole, LogStats, CoreStats, SpiderState
2016-09-05 05:57:08 [scrapy] INFO: Enabled downloader middlewares: HttpAuthMiddleware, DownloadTimeoutMiddleware, UserAgentMiddleware, RetryMiddleware, DefaultHeadersMiddleware, MetaRefreshMiddleware, HttpCompressionMiddleware, RedirectMiddleware, CookiesMiddleware, ChunkedTransferMiddleware, DownloaderStats
2016-09-05 05:57:08 [scrapy] INFO: Enabled spider middlewares: HttpErrorMiddleware, OffsiteMiddleware, RefererMiddleware, UrlLengthMiddleware, DepthMiddleware
2016-09-05 05:57:08 [scrapy] INFO: Enabled item pipelines: 
2016-09-05 05:57:08 [scrapy] INFO: Spider opened
2016-09-05 05:57:08 [scrapy] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2016-09-05 05:57:08 [scrapy] DEBUG: Telnet console listening on 127.0.0.1:6023
2016-09-05 05:57:08 [scrapy] DEBUG: Redirecting (301) to <GET http://www.espn.com/college-football/boxscore?gameId=400869096> from <GET http://espn.go.com/college-football/boxscore?gameId=400869096>
2016-09-05 05:57:08 [scrapy] DEBUG: Crawled (200) <GET http://www.espn.com/college-football/boxscore?gameId=400869096> (referer: None)
2016-09-05 05:57:08 [scrapy] ERROR: Spider error processing <GET http://www.espn.com/college-football/boxscore?gameId=400869096> (referer: None)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 587, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/home/home/CollegeFootballChallenge/cfbScraper/cfbScraper/spiders/boxscore_spider.py", line 232, in parse
    self.parseTeamRushing( teamRushingSel )
  File "/home/home/CollegeFootballChallenge/cfbScraper/cfbScraper/spiders/boxscore_spider.py", line 123, in parseTeamRushing
    self.parsePlayerRushing( playerRushingSel )
  File "/home/home/CollegeFootballChallenge/cfbScraper/cfbScraper/spiders/boxscore_spider.py", line 53, in parsePlayerRushing
    playerUrl = playerRushingSel.xpath( './/a/@href' ).extract()[ 0 ]
IndexError: list index out of range
2016-09-05 05:57:08 [scrapy] INFO: Closing spider (finished)
2016-09-05 05:57:08 [scrapy] INFO: Dumping Scrapy stats:
{'downloader/request_bytes': 503,
 'downloader/request_count': 2,
 'downloader/request_method_count/GET': 2,
 'downloader/response_bytes': 66471,
 'downloader/response_count': 2,
 'downloader/response_status_count/200': 1,
 'downloader/response_status_count/301': 1,
 'finish_reason': 'finished',
 'finish_time': datetime.datetime(2016, 9, 5, 5, 57, 8, 813244),
 'log_count/DEBUG': 3,
 'log_count/ERROR': 1,
 'log_count/INFO': 7,
 'response_received_count': 1,
 'scheduler/dequeued': 2,
 'scheduler/dequeued/memory': 2,
 'scheduler/enqueued': 2,
 'scheduler/enqueued/memory': 2,
 'spider_exceptions/IndexError': 1,
 'start_time': datetime.datetime(2016, 9, 5, 5, 57, 8, 55366)}
2016-09-05 05:57:08 [scrapy] INFO: Spider closed (finished)
rmayf commented 8 years ago
screen shot 2016-09-04 at 11 19 46 pm
rmayf commented 8 years ago

Fixed @38b5c9fd4ac1a8c65dc04b3d25fd10a1674b9da7