I need to parse an html document which contains \"code\" tags
I\'m getting the code blocks like this:
soup = BeautifulSoup(str(content)) code_blocks
Add the code tag to the QUOTE_TAGS dictionary.
from BeautifulSoup import BeautifulSoup content = "List persons = new List();" BeautifulSoup.QUOTE_TAGS['code'] = None soup = BeautifulSoup(str(content)) code_blocks = soup.findAll('code')
List persons = new List();
Output:
[ List persons = new List(); ]