bs4 doc code example
Example 1: beautifulsoup4 install
pip install beautifulsoup4
Example 2: use beautifulsoup
#start
from bs4 import BeautifulSoup
import requests
req = requests.get('https://www.slickcharts.com/sp500')
soup = BeautifulSoup(req.text, 'html.parser')
Example 3: children beautiful soup
li = soup.find('li', {'class': 'text'})
children = li.findChildren("a" , recursive=False)
for child in children:
print child
Example 4: python 3.9 beautifulsoup kurulumu
>python get-pip.py