Python:ParseWeb

From wiki
Revision as of 22:34, 14 July 2020 by Hdridder (talk | contribs) (Created page with "Check the [https://www.crummy.com/software/BeautifulSoup/bs4/doc/ beautifulsoup pages] <syntaxhighlight lang=python> from urllib.request import urlopen import html5lib from b...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Check the beautifulsoup pages

from urllib.request import urlopen
import html5lib
from bs4 import BeautifulSoup

fh = urlopen(url)
soup = BeautifulSoup(fh.read(), 'html.parser')
result = soup.find_all(id = re.compile(pattern))[0].string