This seems to be parser specific:
>>> str(BeautifulSoup('<iframe src="http://xxx/?a=&b=>"></iframe>', 'html.parser'))
'<iframe src="http://xxx/?a=&b=>"></iframe>'
>>> str(BeautifulSoup('<iframe src="http://xxx/?a=&b=>"></iframe>', 'lxml'))
'<html><body><iframe src="http://xxx/?a=&b=&GT"></iframe></body></html>'
>>> str(BeautifulSoup('<iframe src="http://xxx/?a=&b=>"></iframe>', 'html5lib'))
'<html><head></head><body><iframe src="http://xxx/?a=&b=>"></iframe></body></html>'
With all of that said, at least in Chrome, >
will be turned into >
. At least in my tests it did.