开发者

Add content inside html body tag

i created a pyth开发者_StackOverflowon script with the help of BeautifulSoup and i can get some content from a web site.

Now i want with this script to place the code inside the body tag of an html file.

How am i gonna do that ?

thnx


soup = BeautifulSoup(your_old_html)
soup.body.insert(0, your_tag)
print soup

More info here: http://www.crummy.com/software/BeautifulSoup/documentation.html#Adding%20a%20Brand%20New%20Element

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜