Here it (I had some troubles learning CSS selectors' limits :-) ) (probably it would be better to use XPath selectors, shouldn't they be more powerful than CSS selectors?)
The refactored WallhavenDownloader class becomes just
class WallhavenDownloader(CSSDownloader): _NAME = "wallhaven" _SITE = "Wallhaven.cc" _SEARCHURL = "http://alpha.wallhaven.cc/search?q=%s&categories=111&purity=100&sorting=favorites&order=desc" _COUNT_CSS = 'header.listing-header h1' _WALL_CSS = 'figure.thumb' _LINK_CSS = 'figure.thumb a.preview' _SRC_CSS = 'img#wallpaper' _TAGS_CSS = 'a.tagname' _PURITY_CSS= 'input[name="purity"]' _RES_CSS = 'span.wall-res' _PREVIEW_CSS= 'a.preview'
Here it
(I had some troubles learning CSS selectors' limits :-) )
(probably it would be better to use XPath selectors, shouldn't they be more powerful than CSS selectors?)
The refactored WallhavenDownloader class becomes just
class WallhavenDownlo ader(CSSDownloa der): alpha.wallhaven .cc/search? q=%s&categories =111&purity= 100&sorting= favorites& order=desc" listing- header h1' name="purity" ]'
_NAME = "wallhaven"
_SITE = "Wallhaven.cc"
_SEARCHURL = "http://
_COUNT_CSS = 'header.
_WALL_CSS = 'figure.thumb'
_LINK_CSS = 'figure.thumb a.preview'
_SRC_CSS = 'img#wallpaper'
_TAGS_CSS = 'a.tagname'
_PURITY_CSS= 'input[
_RES_CSS = 'span.wall-res'
_PREVIEW_CSS= 'a.preview'