回答編集履歴
1
class名がないときunknownにする
test
CHANGED
@@ -50,8 +50,6 @@
|
|
50
50
|
|
51
51
|
soup = BeautifulSoup(body, "html.parser")
|
52
52
|
|
53
|
-
msgs = soup.find("div", class_="msglist").findAll("div", class_="msg")
|
54
|
-
|
55
53
|
|
56
54
|
|
57
55
|
result = []
|
@@ -62,7 +60,7 @@
|
|
62
60
|
|
63
61
|
|
64
62
|
|
65
|
-
data = {" ".join(i.get("class")): i.get_text() for i in tag.find_all()}
|
63
|
+
data = {" ".join(i.get("class", ["unknown"])) : i.get_text() for i in tag.find_all()}
|
66
64
|
|
67
65
|
|
68
66
|
|