Extract text only from a webpage through "html.parser"
- Get link
- X
- Other Apps
from bs4 import BeautifulSoup
from urllib.request import urlopen
url = "https://en.wikipedia.org/wiki/Kabul#Toponymy_and_etymology"
page = urlopen(url)
html = page.read().decode("utf-8")
soup = BeautifulSoup(html, "html.parser")
print(soup.get_text())
Python
- Get link
- X
- Other Apps
Comments
Post a Comment
Write something to CodeWithAbdur!