0

Having got an element, how do you empty it with BeautifulSoup?

For example, I have a div (as shown below), what do I need to do to clear it's contents?

mydiv = soup.find("div", { "id" : "TopMostInfoBlockContent" })
mydiv.?? #Something here to clear the div contents?
4

1 に答える 1

1

.clear()メソッドを使用します。

mydiv.clear()
于 2013-01-16T10:59:34.990 に答える