(soup: BeautifulSoup, url: str)
| 50 | |
| 51 | |
| 52 | def extract_publisher(soup: BeautifulSoup, url: str) -> str: |
| 53 | publisher = soup.find('meta', property='og:site_name') |
| 54 | if publisher and publisher.get('content'): |
| 55 | return publisher['content'] |
| 56 | domain = urlparse(url).netloc |
| 57 | if domain: |
| 58 | return domain.replace("www.", "") |
| 59 | return '' |
| 60 | |
| 61 | def extract_full_text(soup: BeautifulSoup) -> str: |
| 62 | # Remove unwanted tags: |