回答編集履歴
4
ちょうせい
test
CHANGED
@@ -50,7 +50,7 @@
|
|
50
50
|
|
51
51
|
set i=oIE.Document.getElementsByName("login")
|
52
52
|
|
53
|
-
if i.
|
53
|
+
if i.length=0 then
|
54
54
|
|
55
55
|
msgbox ("エラーです")
|
56
56
|
|
3
調整
test
CHANGED
@@ -3,6 +3,22 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
# sample
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
sample.html
|
10
|
+
|
11
|
+
```HTML
|
12
|
+
|
13
|
+
<form>
|
14
|
+
|
15
|
+
<input type="image" name="login" src="./images/login.gif" border="0" title="ログイン">
|
16
|
+
|
17
|
+
</form>
|
18
|
+
|
19
|
+
```
|
20
|
+
|
21
|
+
|
6
22
|
|
7
23
|
|
8
24
|
|
@@ -14,7 +30,7 @@
|
|
14
30
|
|
15
31
|
sub main()
|
16
32
|
|
17
|
-
URL="http://
|
33
|
+
URL="http://localhost/sample.html"
|
18
34
|
|
19
35
|
|
20
36
|
|
@@ -28,13 +44,13 @@
|
|
28
44
|
|
29
45
|
|
30
46
|
|
31
|
-
|
47
|
+
WScript.sleep 5000
|
32
48
|
|
33
|
-
|
49
|
+
|
34
50
|
|
35
51
|
set i=oIE.Document.getElementsByName("login")
|
36
52
|
|
37
|
-
if
|
53
|
+
if i.item.length=0 then
|
38
54
|
|
39
55
|
msgbox ("エラーです")
|
40
56
|
|
@@ -52,16 +68,6 @@
|
|
52
68
|
|
53
69
|
end sub
|
54
70
|
|
55
|
-
|
71
|
+
```
|
56
72
|
|
57
|
-
Do Until oIE.Busy = False
|
58
|
-
|
59
|
-
WScript.sleep(250)
|
60
|
-
|
61
|
-
Loop
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
73
|
+
※テスト用に修正
|
66
|
-
|
67
|
-
```
|
2
ちょうせい
test
CHANGED
@@ -5,6 +5,8 @@
|
|
5
5
|
# sample
|
6
6
|
|
7
7
|
|
8
|
+
|
9
|
+
sample.vbs
|
8
10
|
|
9
11
|
```VBS
|
10
12
|
|
@@ -61,3 +63,5 @@
|
|
61
63
|
|
62
64
|
|
63
65
|
end function
|
66
|
+
|
67
|
+
```
|
1
chousei
test
CHANGED
@@ -1 +1,63 @@
|
|
1
1
|
状況がよくわかりませんがobjButton[0]とかでは?
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
# sample
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
```VBS
|
10
|
+
|
11
|
+
main()
|
12
|
+
|
13
|
+
sub main()
|
14
|
+
|
15
|
+
URL="http://exsample.com/"
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
Set WSHShell=Wscript.CreateObject("Wscript.Shell")
|
20
|
+
|
21
|
+
set oIE=Wscript.CreateObject("InternetExplorer.application")
|
22
|
+
|
23
|
+
oIE.navigate2(URL)
|
24
|
+
|
25
|
+
oIE.visible=true
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
IEBUSY(oIE)
|
30
|
+
|
31
|
+
set f=oIE.document.forms(0)
|
32
|
+
|
33
|
+
set i=oIE.Document.getElementsByName("login")
|
34
|
+
|
35
|
+
if(f IS Nothing) then
|
36
|
+
|
37
|
+
msgbox ("エラーです")
|
38
|
+
|
39
|
+
oIE.quit()
|
40
|
+
|
41
|
+
exit sub
|
42
|
+
|
43
|
+
end if
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
i.item(0).click()
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
end sub
|
52
|
+
|
53
|
+
function IEBUSY(oIE)
|
54
|
+
|
55
|
+
Do Until oIE.Busy = False
|
56
|
+
|
57
|
+
WScript.sleep(250)
|
58
|
+
|
59
|
+
Loop
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
end function
|