質問編集履歴
4
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
|
42
42
|
|
43
|
-
page.doc.xpath("//*[@class='クラス名']商品コードという文言
|
43
|
+
page.doc.xpath("//*[@class='クラス名']商品コードという文言を抽出").each do |node|
|
44
44
|
|
45
45
|
code = node.xpath("./text()").to_s
|
46
46
|
|
3
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,6 +30,8 @@
|
|
30
30
|
|
31
31
|
<p class="item">商品名</p>
|
32
32
|
|
33
|
+
<p class="item">産地</p> #ない場合がある
|
34
|
+
|
33
35
|
<p class="item">価格</p>
|
34
36
|
|
35
37
|
<p class="item">商品コード:12345678</p>
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,6 +14,12 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
+
マークアップの都合上、その文言がある場合と、ない場合があります
|
18
|
+
|
19
|
+
その為に、順番も変わります。
|
20
|
+
|
21
|
+
|
22
|
+
|
17
23
|
|
18
24
|
|
19
25
|
### 該当のソースコード
|
@@ -22,9 +28,9 @@
|
|
22
28
|
|
23
29
|
```ruby
|
24
30
|
|
31
|
+
<p class="item">商品名</p>
|
25
32
|
|
26
|
-
|
33
|
+
<p class="item">価格</p>
|
27
|
-
|
28
34
|
|
29
35
|
<p class="item">商品コード:12345678</p>
|
30
36
|
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
-
<p class="item
|
29
|
+
<p class="item">商品コード:12345678</p>
|
30
30
|
|
31
31
|
|
32
32
|
|