Skip to content

Commit bc2fbf2

Browse files
committed
load_html_string() should parse out comment lines that start with "//"
1 parent c950e56 commit bc2fbf2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,6 +2590,12 @@ def load_html_string(self, html_string, new_page=True):
25902590
If new_page==True, the page will switch to: "data:text/html,"
25912591
If new_page==False, will load HTML into the current page."""
25922592
self.__check_scope()
2593+
new_lines = []
2594+
lines = html_string.split("\n")
2595+
for line in lines:
2596+
if not line.strip().startswith("//"):
2597+
new_lines.append(line)
2598+
html_string = "\n".join(new_lines)
25932599
soup = self.get_beautiful_soup(html_string)
25942600
found_base = False
25952601
links = soup.findAll("link")

0 commit comments

Comments
 (0)