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

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -