Suppression des saut de ligne et espaces en début et fin de chaînes de caractère
parent
f1aaf196c6
commit
880cb67572
|
|
@ -15,11 +15,12 @@ class GrabvideodataSpider(scrapy.Spider):
|
||||||
def parse_dir_content(self, response):
|
def parse_dir_content(self, response):
|
||||||
for page in response.css("div#content"):
|
for page in response.css("div#content"):
|
||||||
yield {
|
yield {
|
||||||
'titre' : page.css('h1::text').extract_first(),
|
'titre' : page.css('h1::text').extract_first().strip(),
|
||||||
'sous-titre' : page.css('h1 span::text').extract_first(),
|
'sous-titre' : page.css('h1 span::text').extract_first(),
|
||||||
'description' : page.css('.biographies p').extract(),
|
'description' : page.css('.description p').extract(),
|
||||||
'videoSrcUrl' : page.css('iframe::attr(src)').extract_first(),
|
'biographies' : page.css('.biographies p').extract(),
|
||||||
|
'videoSrcUrl' : page.css('iframe::attr(src)').re_first(r'\w[\w\.\/]+'),
|
||||||
'articleUrl' : response.url,
|
'articleUrl' : response.url,
|
||||||
'tags' : page.css('.tag::text').extract()
|
'tags' : page.css('.tag::text').re(r'[\n]')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue