-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.html
69 lines (57 loc) · 2.49 KB
/
output.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css" rel="stylesheet">
<style type="text/css">
.no-border tr > td {border: 0px none !important;}
</style>
<title>Output</title>
</head>
<body>
<div class="panel panel-default" data-spy="affix">
<div class="panel-heading">Summary of the scrapped data</div>
<div class="panel-body">
<p>Number of Items <span class="label label-success" id="numberOfBlock"></span></p>
<p>Unsuccessful ASIN fetch <span class="label label-danger" id="asinMissBlock"></span></p>
<p>Unsuccessful Price fetch <span class="label label-danger" id="priceMissBlock"></span></p>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12 col-lg-12" id="output">
<!-- OUTPUT -->
</div>
</div>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function() {
var trs = $('table tr');
if (trs.length > 0) {
var priceBlocks = $('td.price'),
asinBlocks = $('td.asin'),
priceMissCount = 0,
asinMissCount = 0;
for (var i = 0, len = asinBlocks.length; i < len; i++) {
if(asinBlocks[i].innerHTML === '') {
$(asinBlocks[i]).addClass('danger');
asinMissCount++;
}
}
for (var i = 0, len = priceBlocks.length; i < len; i++) {
if (priceBlocks[i].innerHTML === '') {
$(priceBlocks[i]).addClass('danger');
priceMissCount++;
}
}
$('#numberOfBlock').html($('table').length);
$('#priceMissBlock').html(priceMissCount);
$('#asinMissBlock').html(asinMissCount);
}
});
</script>
</body>
</html>