teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

さらに追記

2020/04/23 07:46

投稿

shirai
shirai

スコア1290

answer CHANGED
@@ -12,4 +12,12 @@
12
12
 
13
13
  ```python
14
14
  driver.find_element_by_xpath('//p[text()="サンプルB"]/following-sibling::div/a').click()
15
+ ```
16
+
17
+ # さらに追記
18
+
19
+ どうぞ
20
+
21
+ ```python
22
+ driver.find_element_by_xpath('//p[contains(text(), "B")]/following-sibling::div/a').click()
15
23
  ```

1

追記

2020/04/23 07:46

投稿

shirai
shirai

スコア1290

answer CHANGED
@@ -4,4 +4,12 @@
4
4
 
5
5
  でいかがでしょうか。
6
6
 
7
- cf) [https://qiita.com/rllllho/items/cb1187cec0fb17fc650a](https://qiita.com/rllllho/items/cb1187cec0fb17fc650a)
7
+ cf) [https://qiita.com/rllllho/items/cb1187cec0fb17fc650a](https://qiita.com/rllllho/items/cb1187cec0fb17fc650a)
8
+
9
+ # コメントを受けて追記
10
+
11
+ 多分以下で行けると思います。
12
+
13
+ ```python
14
+ driver.find_element_by_xpath('//p[text()="サンプルB"]/following-sibling::div/a').click()
15
+ ```