niqdev / packtpub-crawler

Download your daily free Packt Publishing eBook https://www.packtpub.com/packt/offers/free-learning
MIT License
755 stars 178 forks source link

list index out of range | spider.py@97 #80

Closed q1177092 closed 7 years ago

q1177092 commented 7 years ago

Hi,

I use packtpub-crawler from master

git status
# On branch master
nothing to commit, working directory clean

but I now got list index out of range | spider.py@97 error:

/usr/bin/python script/spider.py --config ../packtpub-library/packtpub.cfg --all

[*] 2017-10-07 13:20 - fetching today's eBooks
[*] configuration file: /home/ppc/packtpub-crawler/../packtpub-library/packtpub.cfg
[*] getting daily free eBook
[*] fetching url... 200 | https://www.packtpub.com/packt/offers/free-learning
[*] fetching url... 200 | https://www.packtpub.com//packt/offers/free-learning?login=1
[-] <type 'exceptions.IndexError'> list index out of range | spider.py@97
Traceback (most recent call last):
  File "script/spider.py", line 97, in main
    packtpub.runDaily()
  File "/home/ppc/packtpub-crawler/script/packtpub.py", line 161, in runDaily
    self.__parseDailyBookInfo(soup)
  File "/home/ppc/packtpub-crawler/script/packtpub.py", line 93, in __parseDailyBookInfo
    self.info['url_claim'] = self.__url_base + div_target.select('a.twelve-days-claim')[0]['href']
IndexError: list index out of range
[*] no free eBook from newsletter right now
[*] done

Can you help me?

niqdev commented 7 years ago

Hi, duplicated issue, please refer to #70