Fix AbstruseGoose
This commit is contained in:
parent
42b5aa9321
commit
3fe40326e0
1 changed files with 10 additions and 13 deletions
|
@ -19,24 +19,21 @@ class AbbysAgency(_WordPressScraper):
|
|||
firstStripUrl = stripUrl % 'a'
|
||||
|
||||
|
||||
class AbstruseGoose(_BasicScraper):
|
||||
url = 'http://abstrusegoose.com/'
|
||||
rurl = escape(url)
|
||||
class AbstruseGoose(_ParserScraper):
|
||||
url = 'https://abstrusegoose.com/'
|
||||
starter = bounceStarter
|
||||
stripUrl = url + '%s'
|
||||
firstStripUrl = stripUrl % '1'
|
||||
imageSearch = compile(tagre('img', 'src',
|
||||
r'(http://abstrusegoose\.com/strips/[^<>"]+)'))
|
||||
prevSearch = compile(tagre('a', 'href', r'(%s\d+)' % rurl) +
|
||||
r'« Previous')
|
||||
nextSearch = compile(tagre('a', 'href', r'(%s\d+)' % rurl) +
|
||||
r'Next »')
|
||||
imageSearch = '//img[contains(@src, "/strips/")]'
|
||||
textSearch = imageSearch + '/@title'
|
||||
textOptional = True
|
||||
prevSearch = '//a[contains(text(), "Previous")]'
|
||||
nextSearch = '//a[contains(text(), "Next")]'
|
||||
help = 'Index format: n (unpadded)'
|
||||
textSearch = compile(tagre("img", "title", r'([^"]+)'))
|
||||
|
||||
def namer(self, image_url, page_url):
|
||||
index = int(page_url.rstrip('/').split('/')[-1])
|
||||
name = image_url.split('/')[-1].split('.')[0]
|
||||
def namer(self, imageurl, pageurl):
|
||||
index = int(pageurl.rsplit('/', 1)[1])
|
||||
name = imageurl.rsplit('/', 1)[1]
|
||||
return 'c%03d-%s' % (index, name)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue