artivis / rpipress-downloader

Download Raspberry Pi Press issues
MIT License
18 stars 5 forks source link

Hello World has updated their magazine page which breaks script #8

Closed tripplehelix closed 8 months ago

tripplehelix commented 1 year ago

First issue, helloworld magazine no longer uses a "c-latest-issue" class on its webpage.

Latest HackSpace issue is N°71
Traceback (most recent call last):
  File "/home/tom/.local/bin/rpipress-downloader", line 132, in <module>
    last_issue = soup.find('section', class_="c-latest-issue").findChild("a")['href'].split('/')[-1]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'findChild'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tom/.local/bin/rpipress-downloader", line 134, in <module>
    raise Exception('Could not find latest ' + magazine.name + ' issue number')
Exception: Could not find latest HelloWorld issue number

Second issue, the error above. Guessing both are related as "raise exception" needs an issue number.

Had a quick look for an alternative to see if I could easily fix the issue but can't see anything that answers all three magazines.

ipeps commented 9 months ago

https://github.com/artivis/rpipress-downloader/pull/9 check this version, tested on broken helloworld links