I have a program that gets links from a HTML source file and I want to make it save all the links in a variable and then print only the 4th link. How would I do that?
The code:
soup = BeautifulSoup(z["body"], features="lxml")
for tag in soup.find_all("a"):
links = tag.get("href")