from urllib.request import urlopen from bs4 import BeautifulSoup html = urlopen("http://www.pythonscraping.com/pages/warandpeace.html") bs = BeautifulSoup(html) a = bs.findAll(id="text") print(a[0].get_text())