Skip to content

Commit 3185ee0

Browse files
Fix handling of dodgy buttons (#12)
1 parent babdd22 commit 3185ee0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

css-reports/report.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ async def get_msl_context(
6868

6969
for field in data_response.find_all(name="input"):
7070
if isinstance(field, bs4.Tag):
71-
if field.get("name") and field.get("value"):
71+
if field.get("type") in ["submit", "image", "button"]:
72+
continue
73+
74+
if field.get("name") and field.get("value") is not None:
7275
data_fields[str(field.get("name"))] = str(field.get("value"))
7376

7477
for cookie in field_data.cookies:
@@ -131,6 +134,7 @@ async def fetch_report_url_and_cookies(
131134
)
132135
if not report_viewer_div or report_viewer_div.text.strip() == "":
133136
print("Failed to load the reports.")
137+
print(soup)
134138
print(report_viewer_div)
135139
raise ValueError("Failed to load the reports.")
136140

0 commit comments

Comments
 (0)