BeautifulSoup innerhtml?

前端 未结 6 1523
猫巷女王i
猫巷女王i 2020-11-27 13:28

Let\'s say I have a page with a div. I can easily get that div with soup.find().

Now that I have the result, I\'d like to print the WHOLE <

6条回答
  •  无人及你
    2020-11-27 14:09

    One of the options could be use something like that:

     innerhtml = "".join([str(x) for x in div_element.contents]) 
    

提交回复
热议问题