-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata-scrapping-with-javascript.js
More file actions
101 lines (75 loc) · 3.33 KB
/
Copy pathdata-scrapping-with-javascript.js
File metadata and controls
101 lines (75 loc) · 3.33 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
Data Scrapping with Vanilla JavaScript ( Raw JS )
Tutorial Link: https://www.youtube.com/watch?v=GDJjovLJpMs
Example Website: https://setapp.com/apps
Date: 11th Dec 2021
*/
const items = [];
document.querySelectorAll(".all-apps-item").forEach(function(item){
const _item = {};
_item.name = item.querySelector('.all-apps-item__name').innerHTML.trim();
_item.desc = item.querySelector('.all-apps-item__description').innerHTML.trim();
_item.icon = item.querySelector('.all-apps-item__icon').getAttribute('src').trim();
items.push( _item );
})
console.log( items );
/* For Scrap Transection History */
var items = '';
document.querySelectorAll("table.cust_table tbody tr").forEach(function(item){
items += item.querySelector('td:nth-child(1) span').innerHTML + "\t";
items += item.querySelector('td:nth-child(2)').innerHTML + "\t";
items += item.querySelector('td:nth-child(4)').innerText + "\t\r\n";
})
console.log( items );
/* Set & Get From Localstorage */
var bb = localStorage.getItem('bb');
var items = '';
document.querySelectorAll("table.cust_table tbody tr").forEach(function(item){
items += item.querySelector('td:nth-child(1) span').innerHTML + "\t";
items += item.querySelector('td:nth-child(2)').innerHTML + "\t";
items += item.querySelector('td:nth-child(4)').innerText + "\t\r\n";
})
localStorage.setItem('bb', ( bb + items) );
/* For Profile Photo */
data-imgperflogname="profileCoverPhoto";
var items = '';
document.querySelectorAll("img").forEach(function(item){
console.log( item.getAttribute('src') );
});
/* For Code Canyone */
/* https://codecanyon.net/user/activeitzone/portfolio */
var items = '';
document.querySelectorAll("ul li.js-google-analytics__list-event-container").forEach(function(item){
items += item.querySelector('.product-list__heading a').innerHTML + "\t";
items += item.querySelector('.product-list__price-desktop').innerHTML + "\t";
items += item.querySelector('.product-list__sales-desktop').innerText + "\t\r\n";
})
console.log( items );
/* Bulk SMS Campain log download */
var sms = localStorage.getItem('sms');
var items = '';
document.querySelectorAll("table#sms_log_history_list tbody tr").forEach(function(item){
items += item.querySelector('td:nth-child(2)').innerHTML + "\t";
items += item.querySelector('td:nth-child(3)').innerHTML + "\t";
items += item.querySelector('td:nth-child(7)').innerText + "\t\r\n";
})
console.log( items )
/* Bulk SMS History download */
var sms = localStorage.getItem('sms');
var items = '';
document.querySelectorAll("table#sms_log_list tbody tr").forEach(function(item){
items += item.querySelector('td:nth-child(3)').innerHTML + "\t";
items += item.querySelector('td:nth-child(4) p.hidden').innerText.replace(/(\r\n|\n|\r)/gm, " ") + "\t";
items += item.querySelector('td:nth-child(5)').innerHTML + "\t";
items += item.querySelector('td:nth-child(6)').innerHTML + "\t";
items += item.querySelector('td:nth-child(7)').innerHTML + "\t";
items += item.querySelector('td:nth-child(8)').innerText + "\t\r\n";
})
console.log( items )
=IF(ISNUMBER(SEARCH("আজকের বাচ্চার", C2)), "Agro", "BLPG")
/* Sum Row in Bulk SMS */
var qty = 0;
document.querySelectorAll("table#sms_log_list tbody tr").forEach(function(item){
qty += parseInt( item.querySelector('td:nth-child(6)').innerHTML ) || 0;
})
console.log( qty );