回答編集履歴

2

Update

2022/09/27 06:31

投稿

melian
melian

スコア19825

test CHANGED
@@ -10,8 +10,12 @@
10
10
  を以下の様に変更(CSS セレクタを使います)。
11
11
 
12
12
  ```python
13
- score = soup.select('.voiceDetail-sec02 > table > tr:first-child > th.noBlod:first-child + td')
13
+ score = soup.select('.voiceDetail-sec02 > table > tr:first-child > th.noBlod:first-child + td')
14
- scores += [s.text.strip() for s in score]
14
+ scores += [s.text.strip() for s in score]
15
- tmp_nam += 1
16
- length += 1
17
15
  ```
16
+
17
+ `length` は for ループを抜けた後に、
18
+ ```python
19
+ length += len(scores)
20
+ ```
21
+ とすればよいかと。

1

Update

2022/09/27 06:12

投稿

melian
melian

スコア19825

test CHANGED
@@ -10,8 +10,8 @@
10
10
  を以下の様に変更(CSS セレクタを使います)。
11
11
 
12
12
  ```python
13
- score = soup.select_one('.voiceDetail-sec02 > table > tr:first-child > th:first-child + td')
13
+ score = soup.select('.voiceDetail-sec02 > table > tr:first-child > th.noBlod:first-child + td')
14
- scores.append(score.text.strip())
14
+ scores += [s.text.strip() for s in score]
15
15
  tmp_nam += 1
16
16
  length += 1
17
17
  ```