diff --git a/mechanicalsoup/browser.py b/mechanicalsoup/browser.py index bcb3e25f..0e2f94cf 100644 --- a/mechanicalsoup/browser.py +++ b/mechanicalsoup/browser.py @@ -163,7 +163,10 @@ def _request(self, form, url=None, **kwargs): name = tag.get("name") # name-attribute of tag if tag.name == "input": - if tag.get("type") in ("radio", "checkbox"): + if ( + tag.get("type") is not None and + tag.get("type").lower() in ("radio", "checkbox") + ): if "checked" not in tag.attrs: continue value = tag.get("value", "on") diff --git a/tests/test_browser.py b/tests/test_browser.py index 52d408dd..3bc3b300 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -45,14 +45,14 @@ def test__request(httpbin):
Pizza Size -

Small

-

Medium

+

Small

+

Medium

Large

Pizza Toppings -

Bacon

-

Extra Cheese

+

Bacon

+

Extra Cheese

Onion

Mushroom