What is the most efficient way to insert an element as last one in the bod开发者_StackOverflow社区y
of an HTML page?
See my answer to a previous question along the same lines:
- Extract all <script> tags in an HTML page and append to the bottom of the document
The following should insert just fine:
soup.body.insert(len(soup.body.contents), yourelement)
精彩评论