fix: soup.find(name=...) keyword clash in extract-url
Browse filessoup.find('meta', name='twitter:title') passes 'meta' as first
positional arg (name) AND name= as keyword — BeautifulSoup rejects this.
Use attrs={'name': '...'} instead.
- backend/main.py +2 -2
backend/main.py
CHANGED
|
@@ -528,8 +528,8 @@ def extract_job_url(url: str = Body(..., embed=True)):
|
|
| 528 |
desc = desc_soup.get_text("\n", strip=True)
|
| 529 |
break
|
| 530 |
|
| 531 |
-
meta_title = soup.find("meta", property="og:title") or soup.find("meta",
|
| 532 |
-
meta_desc = soup.find("meta", property="og:description") or soup.find("meta",
|
| 533 |
|
| 534 |
if not title:
|
| 535 |
if meta_title:
|
|
|
|
| 528 |
desc = desc_soup.get_text("\n", strip=True)
|
| 529 |
break
|
| 530 |
|
| 531 |
+
meta_title = soup.find("meta", property="og:title") or soup.find("meta", attrs={"name": "twitter:title"})
|
| 532 |
+
meta_desc = soup.find("meta", property="og:description") or soup.find("meta", attrs={"name": "twitter:description"}) or soup.find("meta", attrs={"name": "description"})
|
| 533 |
|
| 534 |
if not title:
|
| 535 |
if meta_title:
|