Skip to content

Instantly share code, notes, and snippets.

@rtorres90
Created February 19, 2018 19:41
Show Gist options
  • Save rtorres90/9699126c7f9709c8420326dbf56176f5 to your computer and use it in GitHub Desktop.
Save rtorres90/9699126c7f9709c8420326dbf56176f5 to your computer and use it in GitHub Desktop.
import re
raw_html = """<br><input value="4"type="radio"> I'm the first one
<br><input value="5" checked="checked" type="radio"> Second Option!
<br><input value="0" type="radio"> Unselect
</td>"""
print(re.search(r".*checked.+?\>\W*(?P<radiobutton>.+)\<?", raw_html).groupdict().get('radiobutton'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment