diff --git a/src/fundus/publishers/mx/mexico_news_daily.py b/src/fundus/publishers/mx/mexico_news_daily.py index c62fca02a..064509328 100644 --- a/src/fundus/publishers/mx/mexico_news_daily.py +++ b/src/fundus/publishers/mx/mexico_news_daily.py @@ -16,6 +16,8 @@ class MexicoNewsDailyParser(ParserProxy): class V1(BaseParser): + VALID_UNTIL = datetime.date(2026, 7, 27) + _paragraph_selector = XPath("//div[@class='tdb-block-inner td-fix-index']/p[text()] ") _bloat_topics = {"editors_pick"} @@ -55,3 +57,6 @@ def images(self) -> List[Image]: upper_boundary_selector=XPath("//h1"), author_selector=re.compile(r"\((?P.*?)\)\s*$"), ) + + class V1_1(V1): + _paragraph_selector = XPath("//div[@class='tts_content_wrapper_1']/p[text() or strong]") diff --git a/tests/resources/parser/test_data/mx/MexicoNewsDaily.json b/tests/resources/parser/test_data/mx/MexicoNewsDaily.json index 748b1c31a..52494b3e5 100644 --- a/tests/resources/parser/test_data/mx/MexicoNewsDaily.json +++ b/tests/resources/parser/test_data/mx/MexicoNewsDaily.json @@ -212,5 +212,88 @@ "steel aluminum tariffs mexico", "steel trade us-mexico" ] + }, + "V1_1": { + "authors": [ + "César Hernández" + ], + "body": { + "summary": [], + "sections": [ + { + "headline": [], + "paragraphs": [ + "Human error caused a head-on collision by two trains in Chihuahua yesterday that killed a conductor and injured five other crew members, Ferromex officials said.", + "The trains collided about 1:30am on a stretch of track between the cities of Chihuahua and Ciudad Juárez. The conductor of the northbound train died, while five crew members from both trains were injured.", + "The collision sparked a fire that could be seen for several kilometers.", + "Investigations by the rail consortium indicated that the conductor of the southbound train erred by exceeding the authorized indicated speed limit and was running ahead of time.", + "Ferromex, with its subsidiary Ferrosur, is a private rail consortium that operates the largest railway network in Mexico with combined length of 12,070 kilometers." + ] + } + ] + }, + "images": [ + { + "versions": [ + { + "url": "https://mexiconewsdaily.com/wp-content/uploads/2018/05/crash-1-150x92.jpg", + "query_width": null, + "size": { + "width": 150, + "height": 92 + }, + "type": "image/jpeg" + }, + { + "url": "https://mexiconewsdaily.com/wp-content/uploads/2018/05/crash-1-300x184.jpg", + "query_width": null, + "size": { + "width": 300, + "height": 184 + }, + "type": "image/jpeg" + }, + { + "url": "https://mexiconewsdaily.com/wp-content/uploads/2018/05/crash-1-696x427.jpg", + "query_width": null, + "size": { + "width": 696, + "height": 427 + }, + "type": "image/jpeg" + }, + { + "url": "https://mexiconewsdaily.com/wp-content/uploads/2018/05/crash-1-768x471.jpg", + "query_width": null, + "size": { + "width": 768, + "height": 471 + }, + "type": "image/jpeg" + }, + { + "url": "https://mexiconewsdaily.com/wp-content/uploads/2018/05/crash-1.jpg", + "query_width": null, + "size": { + "width": 850, + "height": 521 + }, + "type": "image/jpeg" + } + ], + "is_cover": true, + "description": "The train wreck in Chihuahua yesterday.", + "caption": "The train wreck in Chihuahua yesterday.", + "authors": [], + "position": 804 + } + ], + "publishing_date": "2018-05-31 16:04:54+00:00", + "title": "One dead in Chihuahua train crash; human error blamed", + "topics": [ + "ferromex", + "railway", + "train accident" + ] } } diff --git a/tests/resources/parser/test_data/mx/MexicoNewsDaily_2026_08_18.html.gz b/tests/resources/parser/test_data/mx/MexicoNewsDaily_2026_08_18.html.gz new file mode 100644 index 000000000..af9f250c6 Binary files /dev/null and b/tests/resources/parser/test_data/mx/MexicoNewsDaily_2026_08_18.html.gz differ diff --git a/tests/resources/parser/test_data/mx/meta.info b/tests/resources/parser/test_data/mx/meta.info index a0aae1048..84aff2a84 100644 --- a/tests/resources/parser/test_data/mx/meta.info +++ b/tests/resources/parser/test_data/mx/meta.info @@ -2,5 +2,9 @@ "MexicoNewsDaily_2025_04_16.html.gz": { "url": "https://mexiconewsdaily.com/news/bad-idea-mexico-pushes-back-trump-universal-steel-tariffs/", "crawl_date": "2025-04-16 14:10:08.579331" + }, + "MexicoNewsDaily_2026_08_18.html.gz": { + "url": "https://mexiconewsdaily.com/news/one-dead-in-train-crash-human-error-blamed/", + "crawl_date": "2026-08-18 22:38:32.846902" } }