質問編集履歴
2
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,6 +9,8 @@
|
|
9
9
|
selenium
|
10
10
|
|
11
11
|
|
12
|
+
|
13
|
+
取得元HPのスクレイピングをしようとしています。
|
12
14
|
|
13
15
|
[取得元HP](https://www.superdelivery.com/p/r/pd_p/7890328/)
|
14
16
|
|
@@ -48,6 +50,8 @@
|
|
48
50
|
|
49
51
|
|
50
52
|
|
53
|
+
以下が、実現できなかったので参考にしたページです。
|
54
|
+
|
51
55
|
[参考HP](http://ichannel.tokyo/technoracle/seleniumexcel-%E3%81%9F%E3%81%A3%E3%81%9F%EF%BC%99%E8%A1%8C%E3%81%AEvba%E3%81%A7%E3%82%B9%E3%82%AF%E3%83%AC%E3%82%A4%E3%83%94%E3%83%B3%E3%82%B0%E3%80%80%E5%9F%BA%E6%9C%AC%E7%B7%A8/4094/)
|
52
56
|
|
53
57
|
|
1
環境の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,10 +1,18 @@
|
|
1
|
+
環境
|
2
|
+
|
3
|
+
Windows10 Home 64bit
|
4
|
+
|
5
|
+
Chrome: 81.0.4044.122(Official Build) (64 ビット)
|
6
|
+
|
7
|
+
Excel2010 64bit
|
8
|
+
|
9
|
+
selenium
|
10
|
+
|
11
|
+
|
12
|
+
|
1
13
|
[取得元HP](https://www.superdelivery.com/p/r/pd_p/7890328/)
|
2
14
|
|
3
15
|
```VBA
|
4
|
-
|
5
|
-
Dim breakDown() As String
|
6
|
-
|
7
|
-
|
8
16
|
|
9
17
|
Dim tableElement As Variant
|
10
18
|
|
@@ -15,38 +23,6 @@
|
|
15
23
|
If (tableRow <> 1) Then
|
16
24
|
|
17
25
|
targetRow = targetRow + 1
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
With deliverySheet
|
22
|
-
|
23
|
-
.Name = driver.FindElementsByClass("dl-name-txt")(1).Text
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
Dim element As Variant
|
28
|
-
|
29
|
-
.Cells(targetRow, OUT_SHEET_COL.企業ID).Value = companyID
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
For Each element In driver.FindElementsByClass("co-pc-only")
|
34
|
-
|
35
|
-
If (InStr(element.Text, "SD品番:") > 0) Then
|
36
|
-
|
37
|
-
.Cells(targetRow, OUT_SHEET_COL.SD品番).Value = Replace(element.Text, "SD品番:", "")
|
38
|
-
|
39
|
-
Exit For
|
40
|
-
|
41
|
-
End If
|
42
|
-
|
43
|
-
Next element
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
Erase breakDown
|
48
|
-
|
49
|
-
|
50
26
|
|
51
27
|
Debug.Print tableElement.FindElementsByTag("th")(1).Text
|
52
28
|
|
@@ -63,10 +39,6 @@
|
|
63
39
|
Debug.Print tableElement.FindElementsByTag("td")(6).Text
|
64
40
|
|
65
41
|
Debug.Print tableElement.FindElementsByTag("td")(7).Text
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
End With
|
70
42
|
|
71
43
|
End If
|
72
44
|
|