Fix PHDComics (fixes #238)

This commit is contained in:
Tobias Gruetzmacher 2024-02-15 23:55:46 +01:00
parent 3c203dae72
commit 89b38d450f
No known key found for this signature in database

View file

@ -150,14 +150,16 @@ class PeterAndWhitney(_ParserScraper):
prevSearch = '//a[./img[contains(@src, "nav_previous")]]' prevSearch = '//a[./img[contains(@src, "nav_previous")]]'
class PHDComics(_ParserScraper): class PHDComics(ParserScraper):
BROKEN_COMMENT_END = compile(r'--!>') BROKEN_COMMENT_END = compile(r'--!>')
baseUrl = 'http://phdcomics.com/' baseUrl = 'http://phdcomics.com/'
url = baseUrl + 'comics.php' url = baseUrl + 'comics.php'
stripUrl = baseUrl + 'comics/archive.php?comicid=%s' stripUrl = baseUrl + 'comics/archive.php?comicid=%s'
firstStripUrl = stripUrl % '1' firstStripUrl = stripUrl % '1'
imageSearch = '//img[@id="comic2"]' imageSearch = ('//img[@id="comic2"]',
r'//img[d:class("img-responsive") and re:test(@name, "comic\d+")]')
multipleImagesPerStrip = True
prevSearch = '//a[img[contains(@src, "prev_button")]]' prevSearch = '//a[img[contains(@src, "prev_button")]]'
nextSearch = '//a[img[contains(@src, "next_button")]]' nextSearch = '//a[img[contains(@src, "next_button")]]'
help = 'Index format: n (unpadded)' help = 'Index format: n (unpadded)'
@ -173,7 +175,7 @@ class PHDComics(_ParserScraper):
# video # video
self.stripUrl % '1880', self.stripUrl % '1880',
self.stripUrl % '1669', self.stripUrl % '1669',
) ) or data.xpath('//img[@id="comic" and contains(@src, "phd083123s")]')
class Picklewhistle(ComicControlScraper): class Picklewhistle(ComicControlScraper):