質問編集履歴

1

追加

2019/11/08 14:38

投稿

Mario_11
Mario_11

スコア95

test CHANGED
File without changes
test CHANGED
@@ -51,3 +51,61 @@
51
51
 
52
52
 
53
53
  わかる方教えてください。
54
+
55
+
56
+
57
+ ```python
58
+
59
+ try:
60
+
61
+ explain = driver.find_element_by_xpath("//div[@class='MedicalCheckTabCont MedicalCheckTabWpContent tab1']").text
62
+
63
+ except:
64
+
65
+ explain = driver.find_element_by_xpath("//div[@class='MedicalCheckTabCont tab1 clearfix']").text
66
+
67
+ time.sleep(13)
68
+
69
+ print(explain)
70
+
71
+
72
+
73
+ driver.execute_script("document.getElementsByClassName('MedicalCheckTabCont tab2').style='display: none;'")
74
+
75
+
76
+
77
+ try:
78
+
79
+ point = driver.find_element_by_xpath("//div[@class='MedicalCheckTabCont MedicalCheckTabWpContent tab2']").text
80
+
81
+ except:
82
+
83
+ point = driver.find_element_by_xpath("//div[@class='MedicalCheckTabCont tab2 clearfix']").text
84
+
85
+ time.sleep(13)
86
+
87
+ print(point)
88
+
89
+
90
+
91
+ driver.execute_script("document.getElementsByClassName('MedicalCheckTabCont tab3')[0].style.display = 'none';")
92
+
93
+
94
+
95
+ try:
96
+
97
+ prevention = driver.find_element_by_xpath("//div[@class='MedicalCheckTabCont MedicalCheckTabWpContent tab3']").text
98
+
99
+ except:
100
+
101
+ prevention = driver.find_element_by_xpath("//div[@class='MedicalCheckTabCont tab3 clearfix']").text
102
+
103
+ print(prevention)
104
+
105
+
106
+
107
+ ```
108
+
109
+
110
+
111
+ explain のところは取得できているのでこの書き方で間違い無いと思うのですが、違っていたらご指摘お願いします。