回答編集履歴

1

修正

2020/10/23 03:24

投稿

nto
nto

スコア1438

test CHANGED
@@ -68,6 +68,8 @@
68
68
 
69
69
  speed = special_defence.find_next_sibling()
70
70
 
71
+ average = speed.find_next_sibling()
72
+
71
73
 
72
74
 
73
75
  print(hitpoint.text.split())
@@ -82,6 +84,8 @@
82
84
 
83
85
  print(speed.text.split())
84
86
 
87
+ print(average.text.split())
88
+
85
89
 
86
90
 
87
91
  if '実数値' in tr.text:
@@ -116,18 +120,20 @@
116
120
 
117
121
  >> ◆ ゴリランダーの種族値
118
122
 
119
- ['HP', '100']
123
+ >> ['HP', '100']
120
-
124
+
121
- ['こうげき', '125']
125
+ >> ['こうげき', '125']
122
-
126
+
123
- ['ぼうぎょ', '90']
127
+ >> ['ぼうぎょ', '90']
124
-
128
+
125
- ['とくこう', '60']
129
+ >> ['とくこう', '60']
126
130
 
127
131
  >> ['とくぼう', '70']
128
132
 
129
133
  >> ['すばやさ', '85']
130
134
 
135
+ >> ['平均', '/', '合計', '88.3', '/', '530']
136
+
131
137
 
132
138
 
133
139
  >> ['HP', '207', '207', '175', '175', '160']
@@ -162,6 +168,26 @@
162
168
 
163
169
  elem = tr
164
170
 
171
+ for i in range(7):
172
+
173
+ new_elem = elem.find_next_sibling()
174
+
175
+ box.append(new_elem)
176
+
177
+ elem = new_elem
178
+
179
+
180
+
181
+ data = [elems.text.split() for elems in box]
182
+
183
+ print(data)
184
+
185
+ if '実数値' in tr.text:
186
+
187
+ box = []
188
+
189
+ elem = tr
190
+
165
191
  for i in range(6):
166
192
 
167
193
  new_elem = elem.find_next_sibling()
@@ -172,28 +198,8 @@
172
198
 
173
199
 
174
200
 
175
- data = [elems.text.split() for elems in box]
201
+ data = [[td.string for td in elems.find_all('td')] for elems in box]
176
202
 
177
203
  print(data)
178
204
 
179
- if '実数値' in tr.text:
180
-
181
- box = []
182
-
183
- elem = tr
184
-
185
- for i in range(6):
186
-
187
- new_elem = elem.find_next_sibling()
188
-
189
- box.append(new_elem)
190
-
191
- elem = new_elem
192
-
193
-
194
-
195
- data = [[td.string for td in elems.find_all('td')] for elems in box]
196
-
197
- print(data)
198
-
199
205
  ```