【发布时间】:2015-04-18 22:57:19
【问题描述】:
我试图将美丽汤中的文本导出到文本文件中,但它显示了
"text_file2.write(important)
TypeError: expected a character buffer object"
这是我的代码
important=soup.find_all("tr", class_="accList")
with open("important.txt","w") as text_file2:
text_file2.write(important)
怎么了?
【问题讨论】:
-
这个错误全是
expected a character buffer object。important是一个不是字符缓冲区对象的对象。
标签: python beautifulsoup