# Path: uamobile/scrapers/base.py
# class Scraper(object):
#     # subclass must override this property
#     url = None
# 
#     def scrape(self):
#         stream = self.get_stream()
#         doc = self.get_document(stream)
#         return self.do_scrape(doc)
# 
#     def get_document(self, stream):
#         doc = etree.parse(stream, etree.HTMLParser(remove_comments=True))
#         return doc
# 
#     def get_stream(self):
#         return urllib2.urlopen(self.url)
# 
#     def do_scrape(self, doc):
#         raise NotImplementedError()


from uamobile.scrapers.base import Scraper
# -*- coding: utf-8 -*-

class DoCoMoScraper(Scraper):
    url = 'http://www.nttdocomo.co.jp/service/imode/make/content/ip/'

    def do_scrape(self, doc):
        return [str(x.text) for x in doc.xpath('//div[@class="boxArea" and count(preceding-sibling::*)=2]/div/div[@class="section"]/ul[@class="normal txt" and position()=1]/li')]



# Path: uamobile/scrapers/base.py
# class Scraper(object):
#     # subclass must override this property
#     url = None
# 
#     def scrape(self):
#         stream = self.get_stream()
#         doc = self.get_document(stream)
#         return self.do_scrape(doc)
# 
#     def get_document(self, stream):
#         doc = etree.parse(stream, etree.HTMLParser(remove_comments=True))
#         return doc
# 
#     def get_stream(self):
#         return urllib2.urlopen(self.url)
# 
#     def do_scrape(self, doc):
#         raise NotImplementedError()


# Path: uamobile/scrapers/cidr.py
from uamobile.scrapers.base import Scraper

# -*- coding: utf-8 -*-

class DoCoMoScraper(Scraper):
    url = 'http://www.nttdocomo.co.jp/service/imode/make/content/ip/'

    def do_scrape(self, doc):
        return [str(x.text) for x in doc.xpath('//div[@class="boxArea" and count(preceding-sibling::*)=2]/div/div[@class="section"]/ul[@class="normal txt" and position()=1]/li')]



class EZWebScraper(Scraper):