Examples of Beautiful Soup



In [32]:
from bs4 import BeautifulSoup
import requests
#r = requests.get('http://earlyretirementextreme.com/sitemap.xml')
r = requests.get('http://www.pythonforbeginners.com')
soup = BeautifulSoup(r.text,"html.parser")
#print(soup.prettify())
#for link in soup.find_all('a'):
#    print(link.get('href'))
link = soup.find_all('a')
print(len(link))


8

In [ ]: