Im new with beautifulSoup, so Im practicing my web scraping on this website and the text attribute keeps breaking the .find() function. This is the code:
from bs4 import BeautifulSoup
import requests
url = 'https://montanahistoriclandscape.com/tag/glasgow-montana/'
page = requests.get(url)
soup = BeautifulSoup(page.text, 'lxml')
article = soup.find('article')
first_p = article.find('div', class_='entry-content').p.text
print(first_p)
The code runs fine if I remove the text from the end of the first_p variable; however it gives me the paragraph still in html. But when I add the text it gives me nothing at all as output.
Anyone know whats going on here? I feel like im looking right at it but can't figure it out. Any help would be appreciated!