Use new features to make modules simpler.
This commit is contained in:
parent
b266e28ae1
commit
db87ed95e7
3 changed files with 13 additions and 15 deletions
|
@ -6,22 +6,22 @@
|
|||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
from ..scraper import _ParserScraper
|
||||
from ..helpers import indirectStarter
|
||||
|
||||
|
||||
class _Creators(_ParserScraper):
|
||||
url = 'https://www.creators.com/features/'
|
||||
imageSearch = '//a[contains(@class,"fancybox")]/img'
|
||||
prevSearch = '//a[@id="nav_prev"]'
|
||||
latestSearch = '//div[contains(@class,"caption")]/a'
|
||||
starter = indirectStarter
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return 'Creators/' + super(_Creators, self).name
|
||||
|
||||
def starter(self):
|
||||
start = self.url + self.path
|
||||
data = self.getPage(start)
|
||||
return self.fetchUrl(start, data, self.latestSearch)
|
||||
@property
|
||||
def url(self):
|
||||
return 'https://www.creators.com/features/' + self.path
|
||||
|
||||
|
||||
class _CreatorsEs(_Creators):
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
from ..scraper import _ParserScraper
|
||||
from ..helpers import bounceStarter
|
||||
|
||||
|
||||
class _GoComics(_ParserScraper):
|
||||
|
@ -14,18 +15,16 @@ class _GoComics(_ParserScraper):
|
|||
'//p[@class="feature_item"]/img[@class="strip"]')
|
||||
prevSearch = '//ul[@class="feature-nav"]//a[@class="prev"]'
|
||||
nextSearch = '//ul[@class="feature-nav"]//a[@class="next"]'
|
||||
starter = bounceStarter
|
||||
help = 'Index format: yyyy/mm/dd'
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return 'GoComics/' + super(_GoComics, self).name[2:]
|
||||
|
||||
def starter(self):
|
||||
url1 = self.url + self.path
|
||||
data = self.getPage(url1)
|
||||
url2 = self.fetchUrl(url1, data, self.prevSearch)
|
||||
data = self.getPage(url2)
|
||||
return self.fetchUrl(url2, data, self.nextSearch)
|
||||
@property
|
||||
def url(self):
|
||||
return 'http://www.gocomics.com/' + self.path
|
||||
|
||||
@classmethod
|
||||
def namer(cls, image_url, page_url):
|
||||
|
|
|
@ -7,12 +7,12 @@ from ..scraper import _ParserScraper
|
|||
|
||||
|
||||
class _NuklearPower(_ParserScraper):
|
||||
url = 'http://www.nuklearpower.com/'
|
||||
prevSearch = '//a[@rel="prev"]'
|
||||
imageSearch = '//div[@id="comic"]/img'
|
||||
|
||||
def starter(self):
|
||||
return self.url + self.path + '/'
|
||||
@property
|
||||
def url(self):
|
||||
return 'http://www.nuklearpower.com/' + self.path + '/'
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
@ -26,7 +26,6 @@ class NP8BitTheater(_NuklearPower):
|
|||
class NPAtomicRobo(_NuklearPower):
|
||||
url = 'http://www.atomic-robo.com/'
|
||||
imageSearch = '//img[@id="cc-comic"]'
|
||||
path = 'atomicrobo'
|
||||
|
||||
|
||||
class NPHowIKilledYourMaster(_NuklearPower):
|
||||
|
|
Loading…
Reference in a new issue