回答編集履歴
2
コード例追加
test
CHANGED
@@ -1,4 +1,24 @@
|
|
1
1
|
これでどうですか?
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
```
|
6
|
+
|
7
|
+
links = soup.find_all('a')
|
8
|
+
|
9
|
+
linklist = []
|
10
|
+
|
11
|
+
for link in links:
|
12
|
+
|
13
|
+
linklist.append(link.get('href'))
|
14
|
+
|
15
|
+
print(linklist)
|
16
|
+
|
17
|
+
```
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
あるいは
|
2
22
|
|
3
23
|
|
4
24
|
|
1
コード変更
test
CHANGED
@@ -4,9 +4,7 @@
|
|
4
4
|
|
5
5
|
```
|
6
6
|
|
7
|
-
links = soup.find_all('a')
|
8
|
-
|
9
|
-
linklist = [link.get('href') for link in
|
7
|
+
linklist = [link.get('href') for link in soup.find_all('a')]
|
10
8
|
|
11
9
|
print(linklist)
|
12
10
|
|