import requests from bs4 import BeautifulSoup # Make a request to the homepage of Marfoogle News url = 'https://marfooglenews.com/' response = requests.get(url) # Parse the HTML content of the page using Beautiful Soup soup = BeautifulSoup(response.content, 'html.parser') # Find the latest post on the homepage latest_post = soup.find('div', {'class': 'td_module_10 td_module_wrap td-animation-stack'}) # Extract the link to the daily page from the post daily_page_link = latest_post.find('a', {'class': 'td-image-wrap'})['href'] # Make a request to the daily page and parse the HTML content using Beautiful Soup daily_page_response = requests.get(daily_page_link) daily_page_soup = BeautifulSoup(daily_page_response.content, 'html.parser') # Find all the news articles on the daily page and extract their links news_articles = daily_page_soup.find_all('a', {'class': 'td-image-wrap'}) news_links = [article['href'] for article in news_articles if "affiliate link" not in article.get_text().lower()] print(news_links) pip install beautifulsoup4 import requests from bs4 import BeautifulSoup # Make a request to the homepage of Marfoogle News url = 'https://marfooglenews.com/' response = requests.get(url) # Parse the HTML content of the page using Beautiful Soup soup = BeautifulSoup(response.content, 'html.parser') # Find the latest post on the homepage latest_post = soup.find('div', {'class': 'td_module_10 td_module_wrap td-animation-stack'}) # Extract the link to the news article from the post news_link = latest_post.find('a', {'class': 'td-image-wrap'})['href'] print(news_link)