Using lxml with css selector:
import lxml.html
root = lxml.html.fromstring(html)
matched = root.cssselect('#__VIEWSTATE')
if matched:
value = matched[0].get('value')
Using BeautifulSoup:
from bs4 import BeautifulSoup
soup = BeautifulSoup(html)
matched = soup.select('#__VIEWSTATE')
if matched:
value = matched[0].get('value')