Every week, a new cat or dog is the Ann Arbor’s 107one Pet-of-the-Week. The code below is supposed to get the pet of the week webpage, scrape the text of the title shown in the picture, and print it.
#Get the webpage
# Load libraries for web scraping
from bs4 import BeautifulSoup
import requests
# Get a soup from a URL
url = 'https://www.hshv.org/petsoftheweek/'
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html.parser')
#Get info from one tag
# Get first tag of a certain type from the soup
tag = soup.find('a', class_='pt-cv-none cvplbd')
# Get info from tag
info = tag.get('href')
#Do something with the info
# Print the info
print(info)