I am using Python27. I installed BeautifulSoup4 using pip.
I am getting the following error when i run my code:
UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
To get rid of this warning, change this:
BeautifulSoup([your markup])
to this:
BeautifulSoup([your markup], "html.parser")
markup_type=markup_type))
My code snippet is:
from bs4 import BeautifulSoup
def extract_pass_summary_from_selenium_report():
html_report = open(r"C:\test_runners\selenium_regression_test\ClearCore - Regression Test\TestReport\SeleniumTestReport.html",'r').read()
soup = BeautifulSoup(html_report)
#for i in soup.body:
# print i
for i in soup.findAll('p', align="center"):
print i
If i just run the following line it works:
for i in soup.body:
print i
How can i get around the error? Thanks, Riaz