k how do i check if <body> or <html> is present in the generated file. It might be simple but i am new to soup stuff. I looked into online API documentation and other recipes but i still can't figure out what to write (actually python syntax) in def postprocess_html(self,soup).
can somebody give me the required snippet for the logic given below
if html tag present then
{
return soup
}
else
{
embed html and body tags in the html file
return soup
}
Though I know other languages like c/c++, java but I am new to python and beautiful soup stuff. My only experience with python is writing small recipes by studying other recipes and online API documentation. So my problem might be trivial but I don't know the required syntax.
So guys, I know, what or how(logically) I have to do but just can't figure out what I have to write(syntax).
Please help
|