I have an input-tag looking like this:
<input name="sheet" value="5B" tabindex="994" data-enpassid="__11" type="submit">
Try this. I've created two expressions using css selector and xpath. They both will give you 5B
as result:
html='''
<input name="sheet" value="5B" tabindex="994" data-enpassid="__11" type="submit">
'''
from lxml.html import fromstring
root = fromstring(html)
item = root.cssselect("input")[0].attrib['value']
item1 = root.xpath("//input/@value")[0]
print(item, item1)
Result:
5B, 5B