I am trying to get input values from an HTML doc and want to parse out the values of hidden input fields. For example how can I parse out only the value from the snippet bel
You could use BeautifulSoup:
>>> htmlstr = """ ... """ >>> from BeautifulSoup import BeautifulSoup >>> soup = BeautifulSoup(htmlstr) >>> [(n['name'], n['value']) for n in soup.findAll('input')] [(u'post_form_id', u'd619a1eb3becdc05a3ebea530396782f'), (u'fb_dtsg', u'AQCYsohu')]