Example #1
0
 def obj_shop(self):
     shop = Shop(Env('_id')(self))
     shop.name = Regexp(CleanText('(//div[@xtcz="contacter_le_vendeur"]/div/ul/li)[1]'),
                        'Nom : (.*)')(self)
     shop.location = JSVar(CleanText('//script'), var='tooltip')(self)
     shop.info = CleanText('//div[@xtcz="contacter_le_vendeur"]/div/ul/li[has-class("printPhone")]')(self)
     return shop
Example #2
0
 def obj_shop(self):
     shop = Shop(Env('_id')(self))
     shop.name = Regexp(CleanText('(//div[@xtcz="contacter_le_vendeur"]/div/ul/li)[1]'),
                        'Nom : (.*)')(self)
     shop.location = JSVar(CleanText('//script'), var='tooltip')(self)
     shop.info = CleanText('//div[@xtcz="contacter_le_vendeur"]/div/ul/li[has-class("printPhone")]')(self)
     return shop
Example #3
0
 def get_shop(self, id):
     shop = Shop(id)
     for e in self.document.getroot().cssselect('div#Vendeur'):
         shop.name = self._extract_vendor(e, 'Nom') + '(' + self._extract_vendor(e, 'Vendeur') + ')'
     shop.location = ''
     for adr in self.document.getroot().cssselect('span#AdresseL1,span#AdresseL2'):
         if shop.location:
             shop.location += ', '
         shop.location += adr.text_content().strip()
     for tel in self.document.getroot().cssselect('span.Tel'):
         s = tel.text_content().strip()
         if shop.location:
             shop.location += ', '
         shop.location += re.sub('\s+', ' ', s)
     shop.set_empty_fields(NotAvailable)
     return shop
Example #4
0
 def get_shop(self, id):
     shop = Shop(id)
     for e in self.document.getroot().cssselect("div#Vendeur"):
         shop.name = self._extract_vendor(e, "Nom") + "(" + self._extract_vendor(e, "Vendeur") + ")"
     shop.location = ""
     for adr in self.document.getroot().cssselect("span#AdresseL1,span#AdresseL2"):
         if shop.location:
             shop.location += ", "
         shop.location += adr.text_content().strip()
     for tel in self.document.getroot().cssselect("span.Tel"):
         s = tel.text_content().strip()
         if shop.location:
             shop.location += ", "
         shop.location += re.sub("\s+", " ", s)
     shop.set_empty_fields(NotAvailable)
     return shop
Example #5
0
    def iter_results(self, product=None):
        price = None
        product.name = self.get_product_name()
        for tr in self.document.getroot().cssselect('table#tab_resultat tr'):
            if tr.attrib.get('id', '').startswith('pdv'):
                price = Price('%s.%s' % (product.id, tr.attrib['id'][3:]))

                price.product = product

                tds = tr.findall('td')
                price.cost = Decimal(tds[4].text.replace(',', '.'))
                price.currency = u'€'

                shop = Shop(price.id)
                shop.name = unicode(tds[2].text.strip())
                shop.location = unicode(tds[0].text.strip())

                price.shop = shop
                price.set_empty_fields(NotAvailable)
                yield price
Example #6
0
    def iter_results(self, product=None):
        price = None
        product.name = self.get_product_name()
        for tr in self.document.getroot().cssselect('table#tab_resultat tr'):
            tds = self.parser.select(tr, 'td')
            if tds and len(tds) == 9 and product is not None:
                price = Price('%s.%s' % (product.id, tr.attrib['id']))

                price.product = product

                price.cost = Decimal(tds[5].text.replace(',', '.'))
                price.currency = u'€'

                shop = Shop(price.id)
                shop.name = unicode(tds[3].text.strip())
                shop.location = unicode(tds[2].text.strip())

                price.shop = shop
                price.set_empty_fields(NotAvailable)
                yield price
Example #7
0
    def iter_results(self, product=None):
        price = None
        product.name = self.get_product_name()
        for tr in self.document.getroot().cssselect('table#tab_resultat tr'):
            if tr.attrib.get('id', '').startswith('pdv'):
                price = Price('%s.%s' % (product.id, tr.attrib['id'][3:]))

                price.product = product

                tds = tr.findall('td')
                price.cost = Decimal(tds[4].text.replace(',', '.'))
                price.currency = u'€'

                shop = Shop(price.id)
                shop.name = unicode(tds[2].text.strip())
                shop.location = unicode(tds[0].text.strip())

                price.shop = shop
                price.set_empty_fields(NotAvailable)
                yield price
Example #8
0
    def iter_results(self, product=None):
        price = None
        product.name = self.get_product_name()
        for tr in self.document.getroot().cssselect('table#tab_resultat tr'):
            tds = self.parser.select(tr, 'td')
            if tds and len(tds) == 9 and product is not None:
                price = Price('%s.%s' % (product.id, tr.attrib['id']))

                price.product = product

                price.cost = Decimal(tds[5].text.replace(',', '.'))
                price.currency = u'€'

                shop = Shop(price.id)
                shop.name = unicode(tds[3].text.strip())
                shop.location = unicode(tds[2].text.strip())

                price.shop = shop
                price.set_empty_fields(NotAvailable)
                yield price
Example #9
0
 def get_shop(self, id):
     shop = Shop(id)
     for e in self.document.getroot().cssselect('div#Vendeur'):
         shop.name = self._extract_vendor(
             e, 'Nom') + '(' + self._extract_vendor(e, 'Vendeur') + ')'
     shop.location = ''
     for adr in self.document.getroot().cssselect(
             'span#AdresseL1,span#AdresseL2'):
         if shop.location:
             shop.location += ', '
         shop.location += adr.text_content().strip()
     for tel in self.document.getroot().cssselect('span.Tel'):
         s = tel.text_content().strip()
         if shop.location:
             shop.location += ', '
         shop.location += re.sub('\s+', ' ', s)
     shop.set_empty_fields(NotAvailable)
     return shop
Example #10
0
 def obj_shop(self):
     _id = Field('id')(self)
     shop = Shop(_id)
     shop.name = CleanText('(./td)[4]')(self)
     shop.location = CleanText('(./td)[3]')(self)
     return shop
Example #11
0
def new_shop(id):
    shop = Shop(id)
    shop.set_empty_fields(NotLoaded)
    return shop
Example #12
0
def new_shop(id):
    shop = Shop(id)
    shop.set_empty_fields(NotLoaded)
    return shop
Example #13
0
 def obj_shop(self):
     shop = Shop(CleanText('./p/a/@data-annid')(self))
     return shop
Example #14
0
 def obj_shop(self):
     _id = Field('id')(self)
     shop = Shop(_id)
     shop.name = CleanText('(./td)[4]')(self)
     shop.location = CleanText('(./td)[3]')(self)
     return shop