1#start
2
3
4from bs4 import BeautifulSoup
5import requests
6
7req = requests.get('https://www.slickcharts.com/sp500')
8soup = BeautifulSoup(req.text, 'html.parser')
1from bs4 import BeautifulSoup
2
3with open("index.html") as fp:
4 soup = BeautifulSoup(fp)
5
6soup = BeautifulSoup("<html>a web page</html>")
7