![]() |
VOOZH | about |
Beautifulsoup is a Python library used for web scraping. This powerful python tool can also be used to modify html webpages. This article depicts how beautifulsoup can be employed to delete child element. For this, various methods of the module is used.
Methods Used:
Approach:
Example 1:
Output:
<div id="parent"></div>
Example 2:
Output:
<None></None>
Example 3:
Output:
<div id="parent"> <p> This is child of div with id = "parent". <span>Child of "P"</span> </p> <div> Another Child of div with id = "parent". </div> </div>