html - python BeautifulSoup find all input for specific form -


i'm trying use beautifulsoup extract input fields specific form only.

extracting form using following:

soup.find('form') 

now want extract input fields child form only.

how can bs?

as noted in comments, chain find , find_all() context-specific search:

form = soup.find('form') inputs = form.find_all('input') 

if want direct input elements only, add recursive=false:

form.find_all('input', recursive=false) 

or, using css selectors:

soup.select("form input") 

and, getting direct input child elements only:

soup.select("form > input") 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -