import requests, bs4 res = requests.get('https://www.nostarch.com') res.raise_for_status() noStarchSoup = bs4.BeautifulSoup(res.text) print(type(noStarchSoup)) print(noStarchSoup.select('#main > p:nth-of-type(2)')) print(noStarchSoup.select('p')[1]) print(noStarchSoup.select('p > a')[0].getText()) # https://beautiful-soup-4.readthedocs.io/en/latest/