~metalune/simplynews_sites

ae69b01a366b2e33032eed07b38c550738f62581 — bopol 13 days ago c8a0e5b
franceinfo: fix exception if dateModified does not exist
1 files changed, 2 insertions(+), 3 deletions(-)

M simplynews_sites/franceinfo.py
M simplynews_sites/franceinfo.py => simplynews_sites/franceinfo.py +2 -3
@@ 65,12 65,11 @@ def get_page(url):
    json_element = soup.find("script", type="application/ld+json")
    info = json.loads(json_element.next)

    datePublished = info["datePublished"]
    dateModified = info["dateModified"]
    dateModified = info.get("dateModified")
    if dateModified:
        last_updated = datetime.strptime(dateModified, DATE_PATTERN)
    else:
        last_updated = datetime.strptime(datePublished, DATE_PATTERN)
        last_updated = datetime.strptime(info["datePublished"], DATE_PATTERN)

    author = info["author"]
    authors = []