New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tag type maching case sensitive #245
Comments
Not sure the upper-case version is correct HTML, but anyway, we should be tolerant in what we accept. Patch follows. |
Never trust user input :) I could not find any hard reference but this one comes close to what i think is right https://stackoverflow.com/a/19808575/559333 |
The stackoverflow link is about tag names, but the issue here is about the attribute's content. |
Your right: That asks for more research. [1] http://www.htmlhelp.com/reference/html40/structure.html#attributes |
Anyway, "how HTML should be?" is not very important in real life for tools like MechanicalSoup. "How the HTML you're parsing is?" is the right question (somehow, well-designed websites have a proper API to avoid having to parse HTML, so they don't need MechanicalSoup ...). |
When the form uses upper casing the matching would fail.
MechanicalSoup/mechanicalsoup/browser.py
Line 166 in 5926d0e
Suggest adding .lower()
if tag.get("type").lower() in ("radio", "checkbox"):
The text was updated successfully, but these errors were encountered: