Posted in python
162
2:08 am, April 4, 2021

python url to text with beautiful soup

python using beautiful soup to convert a url into text

Python

from bs4 import BeautifulSoup
from urllib.request import urlopen
url = "https://kruxor.com"
page = urlopen(url)
html = page.read().decode("utf-8")
soup = BeautifulSoup(html, "html.parser")
print(soup.get_text())

python url to text with beautiful soup Demo

View Demo Full Screen View Demo New Tab

python url to text with beautiful soup Code

Related Tags

No Items Found.

Add Comment
Type in a Nick Name here