# 14.7.4. Code debugging activity¶

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.

However, it doesn’t work! Instead of printing the title text, it prints nothing.

Can you fix it? Here is the buggy code:

#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)

Try to fix the buggy code below. Run the code to save your progress.