質問編集履歴
1
HTMLのソースの取得までのソースを追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,33 +10,103 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
+
```ここに言語名を入力
|
14
|
+
|
15
|
+
<div class="data01">
|
16
|
+
|
17
|
+
<a name="aaa"></a>
|
18
|
+
|
19
|
+
<div>***************
|
20
|
+
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<a name="bbb"></a>
|
24
|
+
|
25
|
+
<div>***************
|
26
|
+
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<a name="ccc"></a>
|
30
|
+
|
31
|
+
<div>***************
|
32
|
+
|
33
|
+
</div>
|
34
|
+
|
35
|
+
</div>
|
36
|
+
|
37
|
+
```
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
13
43
|
### 該当のソースコード
|
14
44
|
|
15
45
|
|
16
46
|
|
47
|
+
HTMLのソースの取得までは以下の通り書いてみました。
|
48
|
+
|
17
49
|
```ここに言語名を入力
|
18
50
|
|
19
|
-
|
51
|
+
Sub Main()
|
20
52
|
|
21
|
-
|
53
|
+
Dim objIE As InternetExplorer
|
22
54
|
|
23
|
-
|
55
|
+
Dim objDoc As Object
|
24
56
|
|
25
|
-
|
57
|
+
Dim objtag As Object
|
26
58
|
|
27
|
-
|
59
|
+
Dim url As String
|
28
60
|
|
29
|
-
<div>***************
|
30
61
|
|
31
|
-
</div>
|
32
62
|
|
33
|
-
|
63
|
+
Set objIE = CreateObject("InternetExplorer.Application")
|
34
64
|
|
35
|
-
|
65
|
+
objIE.Visible = True
|
36
66
|
|
37
|
-
|
67
|
+
url = "指定のURLアドレス"
|
38
68
|
|
69
|
+
Call access(objIE, url)
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
For Each objtag In objIE.document.getElementsByTagName("div")
|
74
|
+
|
75
|
+
If InStr(objtag.outerHTML, "data01") <> 0 Then
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
'ここでnameの名前を順番に取得したいのですが方法がわかりません。
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
End If
|
84
|
+
|
85
|
+
Next
|
86
|
+
|
87
|
+
End Sub
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
Sub access(ByRef objIE As Object, ByVal url As String)
|
94
|
+
|
95
|
+
objIE.Navigate url
|
96
|
+
|
97
|
+
|
98
|
+
|
39
|
-
|
99
|
+
'IEを待機
|
100
|
+
|
101
|
+
Do While objIE.Busy = True Or objIE.readyState <> 4
|
102
|
+
|
103
|
+
DoEvents
|
104
|
+
|
105
|
+
Loop
|
106
|
+
|
107
|
+
Call WaitFor(3) '指定秒停止
|
108
|
+
|
109
|
+
End Sub
|
40
110
|
|
41
111
|
```
|
42
112
|
|