質問編集履歴

1

WebBrowser1.Document.GetElementByIdにて要素を取得

2019/02/28 09:54

投稿

TakaakiN
TakaakiN

スコア8

test CHANGED
File without changes
test CHANGED
@@ -24,13 +24,21 @@
24
24
 
25
25
  Dim all As HtmlElementCollection = WebBrowser1.Document.All
26
26
 
27
- Dim forms As HtmlElementCollection = all.GetElementsByName("kensayoteibi")
27
+ 'Dim forms As HtmlElementCollection = all.GetElementsByName("kensayoteibi")
28
+
29
+ Dim forms As HtmlElementCollection
30
+
31
+ Dim box1 As HtmlElement = WebBrowser1.Document.GetElementById("kensayoteibi")
28
32
 
29
33
 
30
34
 
31
35
  Try
32
36
 
37
+ forms = all.GetElementsByName(box1.Name)
38
+
33
39
  forms(0).InnerText = wManryoDate 'placeholderに入ってしまう。本当はvalueに入れたい。
40
+
41
+ System.Windows.Forms.Application.DoEvents()
34
42
 
35
43
 
36
44
 
@@ -40,7 +48,7 @@
40
48
 
41
49
 
42
50
 
43
- System.Windows.Forms.Application.DoEvents()
51
+
44
52
 
45
53
  Catch ex As Exception
46
54