I am trying to extract the HTML of a table from a webpage using BeautifulSoup.
<table class="facts_label" id="facts_table">...</table>
I would like to know why the code below works with "html.parser"and prints noneif I change "html.parser"for "lxml".
from bs4 import BeautifulSoup
from urllib import urlopen
webpage = urlopen('http://www.thewebpage.com')
soup=BeautifulSoup(webpage, "html.parser")
table = soup.find('table', {'class' : 'facts_label'})
print table
source
share