Maybe we want to get just one piece of information from a webpage. In this example, we want to get the first link to a news story from a professorโs page.
If you wanted to get a link from the first โaโ tag on a webpage, which part(s) of the code below would you change? Click on those parts of the code.
Check out the example of this plan above to identify the area that should be changed.
# Get first tag of a certain type from the souptag = soup.find(โdivโ, class_=โComments_StyledComments-dzzyvm-0 dvnRbrโ)# Get info from taginfo = tag.text
Choose the subgoals that prints the text from the tag that has the description of the North Quad dining hall, and put them in the right order. You do not need to use all the blocks.
# Get first tag of a certain type from the soup
tag = soup.find('span', style='font-weight: 400;')
---
# Get first tag of a certain type from the soup
tag = soup.find('span') #paired
---
# Get info from tag
info = tag.text
---
# Get info from tag
info = tag.get('href') #paired
---
# Print the info
print(info)