Skip to content

Commit

Permalink
Simplify [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ping committed Oct 30, 2023
1 parent 535b5ab commit 26deac0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions recipes/foreign-affairs.recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,8 @@ def preprocess_html(self, soup):
modified_dt = datetime.fromisoformat(modified_meta["content"])
if not self.pub_date or modified_dt > self.pub_date:
self.pub_date = modified_dt
for attr in ("ng-src", "data-blazy", "data-src", "srcset"):
for img in soup.findAll("img", attrs={attr: True}):
img["src"] = self.extract_from_img_srcset(img[attr], max_width=800)
for img in soup.find_all("img", attrs={"srcset": True}):
img["src"] = self.extract_from_img_srcset(img["srcset"], max_width=800)
author_info = soup.find(id="author-info")
if author_info:
author_info.name = "div"
Expand Down

0 comments on commit 26deac0

Please sign in to comment.