Bs4 Python Example


Example 1: use beautifulsoup

#start   from bs4 import BeautifulSoup import requests  req = requests.get('https://www.slickcharts.com/sp500') soup = BeautifulSoup(req.text, 'html.parser')

Example 2: beautiful soup 4

from bs4 import BeautifulSoup  with open("index.html") as fp:     soup = BeautifulSoup(fp)  soup = BeautifulSoup("<html>a web page</html>")

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable