class_docstr: Extract the iframes from an html page.
class_docstr_tok: ["Extract","the","iframes","from","an","html","page","."]
code: def handle_starttag(self, tag, attrs):
      if tag == "iframe":
          attrs = dict(attrs)
          if "srcdoc" in attrs:
              html_bytes = attrs["srcdoc"].encode()
          elif "data-html" in attrs:  # legacy
              data_html = attrs["data-html"]
              if "%" in data_html[:20]:
                  # newest branca version: data-html is percent-encoded
                  html_bytes = unquote(data_html).encode()
              else:
                  # legacy branca version: data-html is base64 encoded
                  html_bytes = base64.b64decode(data_html)
          else:  # legacy
              src = attrs["src"]
              html_base64 = src.split(",")[-1]
              html_bytes = base64.b64decode(html_base64)
          self.iframes.append(html_bytes)
  
file_path: folium/tests/selenium/test_selenium.py
imports: import base64
  import glob
  import os
  import subprocess
  from html.parser import HTMLParser
  from urllib.parse import unquote
  import nbconvert
  import pytest
  from selenium.common.exceptions import UnexpectedAlertPresentException
  from folium.utilities import temp_html_filepath
label_desc: Use image node_id 2 for calling the IframeParser obj's underlying member method code with example usage: obj.handle_starttag(tag, attrs) without return types