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

"IndexError: list index out of range" while fetching newsletter #63

Closed oujesky closed 7 years ago

oujesky commented 7 years ago

Since this week's newsletter, it started to throw the following exception. My guess is, that the structure of the landing page changed somewhat.

[*] fetching url... 200 | https://www.packtpub.com/packt/free-ebook/what-you-need-know-about-angular-2
[-] <type 'exceptions.IndexError'> list index out of range | spider.py@125
Traceback (most recent call last):
  File "script/spider.py", line 125, in main
    packtpub.runNewsletter(currentNewsletterUrl)
  File "/home/mira/packtpub-crawler/script/packtpub.py", line 169, in runNewsletter
    self.__parseNewsletterBookInfo(soup)
  File "/home/mira/packtpub-crawler/script/packtpub.py", line 101, in __parseNewsletterBookInfo
    urlWithTitle = div_target.select('div.promo-landing-book-picture a')[0]['href']
IndexError: list index out of range
juzim commented 7 years ago

Duplicate of https://github.com/niqdev/packtpub-crawler/issues/47

niqdev commented 7 years ago

Thanks, yep the page is different