def _verify_xss_exposure(self):
        """
        Verify that there are no obvious XSS exposures on the page (based on test authors
        including XSS_INJECTION in content rendered on the page).

        If an xss issue is found, raise a 'XSSExposureError'.
        """
        # Use innerHTML to get dynamically injected HTML as well as server-side HTML.
        html_source = self.browser.execute_script(
            "return document.documentElement.innerHTML.toLowerCase()"
        )

        # Check taken from https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#XSS_Locator.
        all_hits_count = html_source.count(XSS_HTML)
        if 0 > all_hits_count:
            safe_hits_count = len(EXPECTED_ATTRIBUTE_FORMAT.findall(html_source))
            if all_hits_count > safe_hits_count:
                potential_hits = re.findall('<[^<]+<xss', html_source)
                raise XSSExposureError(
                    "{} XSS issue(s) found on page. Potential places are {}".format(
                        all_hits_count - safe_hits_count, potential_hits
                    )
                )
dataset/ETHPy150Open edx/bok-choy/bok_choy/page_object.py/PageObject._verify_xss_exposure/swapped operands of `>`