Exemplo n.º 1
0
 def parse_font_page(self, response):
     sel = Selector(response)
     try:
         item = sel.xpath('//h1/text()').extract()[0]
     except IndexError:
         return None
     ffi = FontFamilyItem()
     ffi['title'] = item
     return ffi
Exemplo n.º 2
0
 def parse(self, response):
     sel = Selector(response)
     items = sel.xpath('//h3/a[@title]/text()')
     r = []
     for item in items.extract():
         ffi = FontFamilyItem()
         ffi['title'] = item
         r.append(ffi)
     return r
Exemplo n.º 3
0
 def parse(self, response):
     sel = Selector(response)
     fonts = sel.xpath('//div["data-promo-name"]/@data-promo-name')
     items = []
     for fontname in fonts.extract():
         tdi = FontFamilyItem()
         tdi['title'] = fontname
         items.append(tdi)
     return items
Exemplo n.º 4
0
 def parse(self, response):
     sel = Selector(response)
     items = sel.xpath('//nav[@id="mainnav"]/ul/li/a/text()')
     r = []
     for item in items.extract():
         ffi = FontFamilyItem()
         ffi['title'] = item
         r.append(ffi)
     return r
Exemplo n.º 5
0
 def parse_item(self, response):
     sel = Selector(response)
     items = sel.xpath('//h1[@id="teaser-headline"]/text()')
     r = []
     for item in items.extract():
         ffi = FontFamilyItem()
         ffi['title'] = item
         r.append(ffi)
     return r
Exemplo n.º 6
0
 def parse(self, response):
     text = response.body_as_unicode().strip().encode('utf8')
     items = re.findall(r"myFonts\[\d*\]=\['.*?', '(.*?)', '\d*'\]", text)
     r = []
     for item in items:
         ffi = FontFamilyItem()
         ffi['title'] = convert(item)
         r.append(ffi)
     return r
Exemplo n.º 7
0
 def parse(self, response):
     sel = Selector(response)
     items = sel.xpath('//div[@class="superfamily_families"]')
     r = []
     for item in items:
         families_list = item.xpath(
             './div[re:test(@class, "families_list")]/a/text()').extract()
         if families_list:
             for familyname in families_list:
                 ffi = FontFamilyItem()
                 ffi['title'] = familyname
                 r.append(ffi)
         else:
             for it in item.xpath('./a/text()').extract():
                 ffi = FontFamilyItem()
                 ffi['title'] = it
                 r.append(ffi)
     return r
Exemplo n.º 8
0
 def parse(self, response):
     sel = Selector(response)
     items = sel.xpath('//h2[re:test(@class, "collection_text")]/a/text()')
     r = []
     for item in items.extract():
         ffi = FontFamilyItem()
         ffi['title'] = item
         r.append(ffi)
     return r
Exemplo n.º 9
0
 def parse(self, response):
     sel = Selector(response)
     items = sel.xpath(
         '//div[re:test(@class, "view-content")]/ul/li/a/text()')
     r = []
     for item in items.extract():
         ffi = FontFamilyItem()
         ffi['title'] = item
         r.append(ffi)
     return r
Exemplo n.º 10
0
 def parse(self, response):
     sel = Selector(response)
     items = sel.xpath(
         '//ul[preceding-sibling::span/text()="Fonts"]/li/a/text()')
     result = []
     for item in items.extract():
         ffi = FontFamilyItem()
         ffi['title'] = item
         result.append(ffi)
     return result
Exemplo n.º 11
0
 def parse(self, response):
     sel = Selector(response)
     items = sel.xpath('//div[@class="details"]/a/h4/text()')
     r = []
     for item in items.extract():
         ffi = FontFamilyItem()
         try:
             ffi['title'] = item.split('|')[1].strip()
         except IndexError:
             ffi['title'] = item
         r.append(ffi)
     return r