properly define urls

This commit is contained in:
Bezleputh 2015-01-19 10:24:53 +01:00 committed by Romain Bignon
commit e0cb4118f8
11 changed files with 12 additions and 12 deletions

View file

@ -30,7 +30,7 @@ class AgendadulibreBrowser(PagesBrowser):
event_page = URL('events/(?P<_id>.*)', EventPage) event_page = URL('events/(?P<_id>.*)', EventPage)
def __init__(self, website, region, *args, **kwargs): def __init__(self, website, region, *args, **kwargs):
self.BASEURL = u'%s' % website self.BASEURL = u'%s/' % website
self.region = '&region=%s' % region if region else '' self.region = '&region=%s' % region if region else ''
PagesBrowser.__init__(self, *args, **kwargs) PagesBrowser.__init__(self, *args, **kwargs)

View file

@ -24,7 +24,7 @@ from .pages import CitiesPage, SearchPage, HousingPage, HousingPage2, PhonePage
class ExplorimmoBrowser(PagesBrowser): class ExplorimmoBrowser(PagesBrowser):
BASEURL = 'http://www.explorimmo.com' BASEURL = 'http://www.explorimmo.com/'
cities = URL('rest/locations\?q=(?P<city>.*)', CitiesPage) cities = URL('rest/locations\?q=(?P<city>.*)', CitiesPage)
search = URL('resultat/annonces.html\?(?P<query>.*)', SearchPage) search = URL('resultat/annonces.html\?(?P<query>.*)', SearchPage)

View file

@ -27,7 +27,7 @@ __all__ = ['FeedlyBrowser']
class FeedlyBrowser(LoginBrowser): class FeedlyBrowser(LoginBrowser):
BASEURL = 'http://www.feedly.com' BASEURL = 'http://www.feedly.com/'
essentials = URL('http://s3.feedly.com/essentials/essentials_fr.json', EssentialsPage) essentials = URL('http://s3.feedly.com/essentials/essentials_fr.json', EssentialsPage)
token = URL('v3/auth/token', TokenPage) token = URL('v3/auth/token', TokenPage)

View file

@ -27,7 +27,7 @@ __all__ = ['HybrideBrowser']
class HybrideBrowser(PagesBrowser): class HybrideBrowser(PagesBrowser):
PROFILE = Firefox() PROFILE = Firefox()
BASEURL = 'http://www.lhybride.org' BASEURL = 'http://www.lhybride.org/'
program_page = URL('programme.html', ProgramPage) program_page = URL('programme.html', ProgramPage)
event_page = URL('programme/item/(?P<_id>.*)', EventPage) event_page = URL('programme/item/(?P<_id>.*)', EventPage)

View file

@ -23,7 +23,7 @@ from .pages import CityListPage, HousingListPage, HousingPage
class LeboncoinBrowser(PagesBrowser): class LeboncoinBrowser(PagesBrowser):
BASEURL = 'http://www.leboncoin.fr' BASEURL = 'http://www.leboncoin.fr/'
city = URL('ajax/location_list.html\?city=(?P<city>.*)&zipcode=(?P<zip>.*)', CityListPage) city = URL('ajax/location_list.html\?city=(?P<city>.*)&zipcode=(?P<zip>.*)', CityListPage)
search = URL('(?P<type>.*)/offres/(?P<region>.*)/occasions/\?ps=(?P<ps>.*)&pe=(?P<pe>.*)&ros=(?P<ros>.*)&location=(?P<location>.*)&sqs=(?P<sqs>.*)&sqe=(?P<sqe>.*)&ret=(?P<ret>.*)&f=(?P<advert_type>.*)', search = URL('(?P<type>.*)/offres/(?P<region>.*)/occasions/\?ps=(?P<ps>.*)&pe=(?P<pe>.*)&ros=(?P<ros>.*)&location=(?P<location>.*)&sqs=(?P<sqs>.*)&sqe=(?P<sqe>.*)&ret=(?P<ret>.*)&f=(?P<advert_type>.*)',
'(?P<_type>.*)/offres/(?P<_region>.*)/occasions.*?', '(?P<_type>.*)/offres/(?P<_region>.*)/occasions.*?',

View file

@ -24,7 +24,7 @@ from .pages import CitiesPage, SearchPage, HousingPage, PhonePage
class LogicimmoBrowser(PagesBrowser): class LogicimmoBrowser(PagesBrowser):
BASEURL = 'http://www.logic-immo.com' BASEURL = 'http://www.logic-immo.com/'
city = URL('asset/t9/t9_district/fr/(?P<size>\d*)/(?P<first_letter>\w)/(?P<pattern>.*)\.txt\?json=%22(?P<pattern2>.*)%22', city = URL('asset/t9/t9_district/fr/(?P<size>\d*)/(?P<first_letter>\w)/(?P<pattern>.*)\.txt\?json=%22(?P<pattern2>.*)%22',
CitiesPage) CitiesPage)

View file

@ -27,7 +27,7 @@ __all__ = ['MonsterBrowser']
class MonsterBrowser(PagesBrowser): class MonsterBrowser(PagesBrowser):
BASEURL = 'http://offres.monster.fr' BASEURL = 'http://offres.monster.fr/'
advert = URL('http://offre-emploi.monster.fr/(?P<_id>.*).aspx', AdvertPage) advert = URL('http://offre-emploi.monster.fr/(?P<_id>.*).aspx', AdvertPage)
search = URL('rechercher\?q=(?P<pattern>.*)', search = URL('rechercher\?q=(?P<pattern>.*)',
'PowerSearch.aspx\?q=(?P<job_name>.*)&where=(?P<place>.*)&jt=(?P<contract>.*)&occ=(?P<job_category>.*)&tm=(?P<limit_date>.*)&indid=(?P<activity_domain>)', 'PowerSearch.aspx\?q=(?P<job_name>.*)&where=(?P<place>.*)&jt=(?P<contract>.*)&occ=(?P<job_category>.*)&tm=(?P<limit_date>.*)&indid=(?P<activity_domain>)',

View file

@ -27,7 +27,7 @@ __all__ = ['PopolemploiBrowser']
class PopolemploiBrowser(PagesBrowser): class PopolemploiBrowser(PagesBrowser):
BASEURL = 'http://candidat.pole-emploi.fr' BASEURL = 'http://candidat.pole-emploi.fr/'
advert = URL('candidat/rechercheoffres/detail/(?P<id>.*)', AdvertPage) advert = URL('candidat/rechercheoffres/detail/(?P<id>.*)', AdvertPage)
search = URL('candidat/rechercheoffres/resultats/(?P<search>.*?)', search = URL('candidat/rechercheoffres/resultats/(?P<search>.*?)',

View file

@ -27,7 +27,7 @@ __all__ = ['RazibusBrowser']
class RazibusBrowser(PagesBrowser): class RazibusBrowser(PagesBrowser):
BASEURL = 'http://razibus.net' BASEURL = 'http://razibus.net/'
TIMEOUT = 20 TIMEOUT = 20
event_list_page = URL('evenements-a-venir.php\?region=(?P<region>.*)', EventListPage) event_list_page = URL('evenements-a-venir.php\?region=(?P<region>.*)', EventListPage)
event_page = URL('(?P<_id>.*).html', EventPage) event_page = URL('(?P<_id>.*).html', EventPage)

View file

@ -31,7 +31,7 @@ class RegionsjobBrowser(PagesBrowser):
advert_page = URL('emplois/(?P<_id>.*)\.html', AdvertPage) advert_page = URL('emplois/(?P<_id>.*)\.html', AdvertPage)
def __init__(self, website, *args, **kwargs): def __init__(self, website, *args, **kwargs):
self.BASEURL = 'http://%s' % website self.BASEURL = 'http://%s/' % website
PagesBrowser.__init__(self, *args, **kwargs) PagesBrowser.__init__(self, *args, **kwargs)
def search_job(self, pattern='', fonction='', secteur='', contract='', def search_job(self, pattern='', fonction='', secteur='', contract='',
@ -61,5 +61,5 @@ class RegionsjobBrowser(PagesBrowser):
def get_job_advert(self, _id, advert): def get_job_advert(self, _id, advert):
splitted_id = _id.split('#') splitted_id = _id.split('#')
self.BASEURL = 'http://www.%s.com' % splitted_id[0] self.BASEURL = 'http://www.%s.com/' % splitted_id[0]
return self.advert_page.go(_id=splitted_id[1]).get_job_advert(obj=advert) return self.advert_page.go(_id=splitted_id[1]).get_job_advert(obj=advert)

View file

@ -28,7 +28,7 @@ __all__ = ['TwitterBrowser']
class TwitterBrowser(LoginBrowser): class TwitterBrowser(LoginBrowser):
BASEURL = 'https://twitter.com' BASEURL = 'https://twitter.com/'
thread_page = URL(u'(?P<user>.+)/status/(?P<_id>.+)', ThreadPage) thread_page = URL(u'(?P<user>.+)/status/(?P<_id>.+)', ThreadPage)
login_error = URL(u'login/error.+', LoginErrorPage) login_error = URL(u'login/error.+', LoginErrorPage)