I wrote a python spyder crawled the contents of a web page. How can I print the < br >，" < p > < /p >" tag of html language to make more beatiful?
Where do you want to print them? Are they the part of the content fetched from the webpage?
If you want to display them in the browser as html breaking rule and a paragraph - you just need to output them in html results your program produces ("<br/>", “<p>text</p>”).
If they are a part of the scraped content, then it depends on if/how you processed them.
These characters are interpreted by browser as delimiters of html tags (html elements).
If you have them in the content and you want them displayed as chevrons, the you need to escape them (these characters are called html entities) as < and >
There’s a “html” module in Python that can do it for you.
>>> import html >>> html.escape("<br/>") '<br/>' >>> html.unescape('<br/>') '<br/>'