質問編集履歴

2

タイトルの文章がわかりにくかったので変更

2019/01/16 01:25

投稿

og33
og33

スコア14

test CHANGED
@@ -1 +1 @@
1
- seleniumで要素のidが変わる場所をクリックしたい
1
+ seleniumでロードするたびにidが変わる要素をクリックしたい
test CHANGED
File without changes

1

実行コードの書き忘れと、find_elements_by_xpathからfind_element_by_xpathにしたのでエラー内容を変更

2019/01/16 01:25

投稿

og33
og33

スコア14

test CHANGED
File without changes
test CHANGED
@@ -24,19 +24,17 @@
24
24
 
25
25
  ```
26
26
 
27
- Traceback (most recent call last):
28
-
29
- File "webdriver.py", line 24, in <module>
30
-
31
- driver.find_elements_by_xpath(".//span[contains(text(), 'is unknown')]").click()
27
+ driver.find_element_by_xpath(".//span[contains(text(), 'is unknown')]").click()
32
-
33
- AttributeError: 'list' object has no attribute 'click'
34
28
 
35
29
  ```
36
30
 
37
- listオブジェクトはクリックできないらしいです。
31
+ ```
38
32
 
33
+ selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":".//span[contains(text(), 'is unknown')]"}
34
+
35
+ ```
36
+
39
- これではそもそも要素が特定できてかもわかりません
37
+ 要素が見つからなことです
40
38
 
41
39
 
42
40