I want to grab the value of a hidden input field in HTML.
I
I agree with Vinko BeautifulSoup is the way to go. However I suggest using fooId['value']
to get the attribute rather than relying on value being the third attribute.
from BeautifulSoup import BeautifulSoup
#Or retrieve it from the web, etc.
html_data = open('/yourwebsite/page.html','r').read()
#Create the soup object from the HTML data
soup = BeautifulSoup(html_data)
fooId = soup.find('input',name='fooId',type='hidden') #Find the proper tag
value = fooId['value'] #The value attribute