Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SamirPS authored Mar 27, 2021
1 parent 193b760 commit b9557c0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions newsscrapper/fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,17 @@ def BmftvSC():


def LibeSC():
Liberation=requests.get("http://rss.liberation.fr/rss/latest/")
Liberation=requests.get("https://www.liberation.fr/arc/outboundfeeds/rss/?outputType=xml")
s=Liberation.text
s=s.replace("\n","")
arlibe=re.findall(r'<entry>(.*?)</entry>',s)
arlibe=re.findall(r'<item>(.*?)</item>',s)
data={}
for i in range(len(arlibe)):
picture=re.findall(r'https://medias.liberation.fr/photo/(.*?);ratio',arlibe[i])
link=re.findall(r'<link href="(.*?)"',arlibe[i])
picture=re.findall(r'https://liberation-liberation-prod.cdn.arcpublishing.com/resizer/(.*?)">',arlibe[i])
link=re.findall(r'<link>(.*?)</link>',arlibe[i])
title=re.findall(r'<title>(.*?)</title>',arlibe[i])
addj="https://medias.liberation.fr/photo/"
title[0]=title[0].replace("<![CDATA[","").replace("]]>","")
addj="https://liberation-liberation-prod.cdn.arcpublishing.com/resizer/"
try:
data[str(i)]={"link":link[0],"img":addj+picture[0],"title":title[0].replace(u"\xa0"," ")}
except:
Expand Down Expand Up @@ -113,4 +114,3 @@ def FTISC():




0 comments on commit b9557c0

Please sign in to comment.