質問編集履歴
1
リスト画像の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,85 +10,27 @@
|
|
10
10
|
### 前提
|
11
11
|
|
12
12
|
■対象サイト
|
13
|
+
https://usa.visa.com/support/consumer/travel-support/exchange-rate-calculator.html
|
13
14
|
|
14
15
|
上記サイトにて為替レートの情報を得るには
|
15
16
|
「Calculate Conversion」のボタンをクリックする前に
|
16
17
|
「from」「to」の通貨をマウスにてクリックして選択する必要があります。
|
17
18
|
|
18
|
-
p
|
19
|
+

|
19
|
-
駄目でした。
|
20
20
|
|
21
|
+
ActionChainsで「from」のボタンをクリックし
|
22
|
+
上記リストを表示させるところまではできるのですが、
|
23
|
+
その後に表示されるリストをマウスでクリックさせる方法が
|
24
|
+
見当たらず躓いています。
|
25
|
+
|
26
|
+
ここでsend_keys('USD')などで入力してしまうと、
|
27
|
+
最後の「Calculate Conversion」をクリックした段階で
|
21
|
-
|
28
|
+
エラーとなるので、リストからマウスでのクリックで
|
22
|
-
進める
|
29
|
+
進める必要があると考えています。
|
23
30
|
|
24
31
|
|
25
32
|
|
26
|
-
### 発生している問題・エラーメッセージ
|
27
33
|
|
28
|
-
マウスでクリックせずに進めると
|
29
|
-
下記エラーになります。
|
30
|
-
|
31
|
-
```
|
32
|
-
---------------------------------------------------------------------------
|
33
|
-
ElementNotInteractableException Traceback (most recent call last)
|
34
|
-
Cell In[30], line 6
|
35
|
-
1 #calculateボタンの要素を取得
|
36
|
-
3 calculate_btn = browser.find_element(
|
37
|
-
4 By.XPATH, "//dm-calculator"
|
38
|
-
5 ).shadow_root.find_element(By.CSS_SELECTOR, "button.vs-btn.vs-btn-primary")
|
39
|
-
----> 6 calculate_btn.click()
|
40
|
-
|
41
|
-
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webelement.py:93, in WebElement.click(self)
|
42
|
-
91 def click(self) -> None:
|
43
|
-
92 """Clicks the element."""
|
44
|
-
---> 93 self._execute(Command.CLICK_ELEMENT)
|
45
|
-
|
46
|
-
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webelement.py:410, in WebElement._execute(self, command, params)
|
47
|
-
408 params = {}
|
48
|
-
409 params["id"] = self._id
|
49
|
-
--> 410 return self._parent.execute(command, params)
|
50
|
-
|
51
|
-
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py:444, in WebDriver.execute(self, driver_command, params)
|
52
|
-
442 response = self.command_executor.execute(driver_command, params)
|
53
|
-
443 if response:
|
54
|
-
--> 444 self.error_handler.check_response(response)
|
55
|
-
445 response["value"] = self._unwrap_value(response.get("value", None))
|
56
|
-
446 return response
|
57
|
-
|
58
|
-
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py:249, in ErrorHandler.check_response(self, response)
|
59
|
-
247 alert_text = value["alert"].get("text")
|
60
|
-
248 raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here
|
61
|
-
--> 249 raise exception_class(message, screen, stacktrace)
|
62
|
-
|
63
|
-
ElementNotInteractableException: Message: element not interactable
|
64
|
-
(Session info: chrome=109.0.5414.120)
|
65
|
-
Stacktrace:
|
66
|
-
Backtrace:
|
67
|
-
(No symbol) [0x00B06643]
|
68
|
-
(No symbol) [0x00A9BE21]
|
69
|
-
(No symbol) [0x0099D960]
|
70
|
-
(No symbol) [0x009D23A7]
|
71
|
-
(No symbol) [0x009C6B13]
|
72
|
-
(No symbol) [0x009EFD7C]
|
73
|
-
(No symbol) [0x009C641F]
|
74
|
-
(No symbol) [0x009F00D4]
|
75
|
-
(No symbol) [0x00A06B09]
|
76
|
-
(No symbol) [0x009EFB76]
|
77
|
-
(No symbol) [0x009C49C1]
|
78
|
-
(No symbol) [0x009C5E5D]
|
79
|
-
GetHandleVerifier [0x00D7A142+2497106]
|
80
|
-
GetHandleVerifier [0x00DA85D3+2686691]
|
81
|
-
GetHandleVerifier [0x00DABB9C+2700460]
|
82
|
-
GetHandleVerifier [0x00BB3B10+635936]
|
83
|
-
(No symbol) [0x00AA4A1F]
|
84
|
-
(No symbol) [0x00AAA418]
|
85
|
-
(No symbol) [0x00AAA505]
|
86
|
-
(No symbol) [0x00AB508B]
|
87
|
-
BaseThreadInitThunk [0x764400F9+25]
|
88
|
-
RtlGetAppContainerNamedObjectPath [0x77AE7BBE+286]
|
89
|
-
RtlGetAppContainerNamedObjectPath [0x77AE7B8E+238]
|
90
|
-
|
91
|
-
```
|
92
34
|
|
93
35
|
### 該当のソースコード
|
94
36
|
|
@@ -150,24 +92,13 @@
|
|
150
92
|
sleep(4)
|
151
93
|
tran_date.send_keys('12/01/2022')
|
152
94
|
|
95
|
+
#Fromのプルダウン選択
|
96
|
+
from_list = browser.find_element(
|
97
|
+
By.XPATH, "//dm-calculator"
|
98
|
+
).shadow_root.find_element(By.CSS_SELECTOR, "button.vs-btn.vs-btn-dropdown-icon")
|
99
|
+
from_list.click()
|
153
100
|
|
154
|
-
|
155
|
-
#↓↓エラーの該当箇所です↓↓
|
156
|
-
|
157
|
-
#calculateボタンの要素を取得
|
158
|
-
|
159
|
-
calculate_btn = browser.find_element(
|
160
|
-
By.XPATH, "//dm-calculator"
|
161
|
-
).shadow_root.find_element(By.CSS_SELECTOR, "button.vs-btn.vs-btn-primary")
|
162
|
-
calculate_btn.click()
|
163
101
|
```
|
164
|
-
|
165
|
-
### 試したこと
|
166
|
-
|
167
|
-
ActionChainsで「from」のボタンをクリックする
|
168
|
-
ところまではできるのですが、
|
169
|
-
その後に表示されるリストをマウスでクリックさせる方法が
|
170
|
-
見当たらず躓いています。
|
171
102
|
|
172
103
|
|
173
104
|
|