質問編集履歴
2
コード書き替え
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,24 +12,26 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
+
for elem in elme:
|
16
|
+
|
15
|
-
elme.find_element
|
17
|
+
elem_url = elme.find_element_by_tag_name("a").get_attribute("href")
|
16
18
|
|
17
19
|
|
18
20
|
|
19
21
|
エラー
|
20
22
|
|
21
|
-
|
23
|
+
|
22
24
|
|
23
25
|
AttributeError Traceback (most recent call last)
|
24
26
|
|
25
|
-
<ipython-input-1
|
27
|
+
<ipython-input-182-68bf6960063c> in <module>
|
26
|
-
|
27
|
-
1 elme = driver.find_elements_by_tag_name("h2")
|
28
28
|
|
29
29
|
2
|
30
30
|
|
31
|
+
3 for elem in elme:
|
32
|
+
|
31
|
-
---->
|
33
|
+
----> 4 elem_url = elme.find_element_by_tag_name("a").get_attribute("href")
|
32
34
|
|
33
35
|
|
34
36
|
|
35
|
-
AttributeError: 'list' object has no attribute 'find_element
|
37
|
+
AttributeError: 'list' object has no attribute 'find_element_by_tag_name'
|
1
複数取得に変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
|
3
3
|
解決方法を教えていただきたいです。
|
4
4
|
|
5
|
+
複数のhrefを抜き出したいです。
|
5
6
|
|
6
7
|
|
7
|
-
|
8
|
+
|
9
|
+
|
8
10
|
|
9
11
|
elme = driver.find_elements_by_tag_name("h2")
|
10
12
|
|