initial commit for the-great-escape yuku scraper

This commit is contained in:
Adrian Malacoda
2016-11-26 23:09:12 -06:00
parent e5fb7e5c9a
commit 933e178ce5
8 changed files with 219 additions and 0 deletions

17
tge/scrapers/__init__.py Normal file
View File

@@ -0,0 +1,17 @@
from . import yuku
scrapers = [yuku]
def get_scraper (name):
for scraper in scrapers:
if scraper.__name__.endswith(".{}".format(name)):
return scraper
raise Exception("Unknown scraper: {}".format(name))
def guess_scraper (url):
for scraper in scrapers:
if scraper.can_scrape_url(url):
return scraper
raise Exception("Unable to guess scraper for forum url: {}".format(url))