python BeautifulSoup get specific element

Viewed 10673

if i have an html code like this

<div class="new_info_next">
     <input type="hidden" value="133" id="new_id" class="new_id">
     <input type="hidden" value="0" id="default_pe" class="default_pe">
</div>

and i want to get only 133 in input the first line i try this code using BeautifulSoup4

info = soup.find_all("div", {"class": "new_info_next"})
for inpu in info:
    for inpu1 in inpu.select('input'):
         print inpu1 .get('value')

but the output was

133
0

how to get only 133

2 Answers
Related