Comment 15 for bug 1377655

Revision history for this message
PheniX (a-sterbini) wrote :

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'