/
setting.data
159 lines (159 loc) · 3.49 KB
/
setting.data
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
option = {
'url' : 'url_to_crawl', #starting url of a website
'file_name' : 'project_file_name', #file name to save json data
'file_dir' : 'projects/project_name/saved', #replace project name with ur project name
'homepage' : 'https://www.example.com', #homepage of the website
'selector' : {
'parent' : '.cntanr', #specify the parent selector
'element' : '.jcn > a' #specify the child selector
},
'pagination' : {
'url' : 'https://www.example.com/ajax.php?search1={search1}&search2={search2}&page={page}', #pagination url for the next page to crawl
'replace' : {
'search1' : 'search1_data', #replace data in pagination url
'search2' : 'search2_data' #replace data in pagination url
},
'start' : 1, #Starting page index
'step' : 1, #Step to increase page index
'request' : {
'header' : { #optional for few sites
'cookie' : '',
'referer' : 'https://www.example.com/',
},
'data' : { #optional for few sites
'type' : 'json',
'selector' : 'markup'
}
}
},
'fields' : [{ #specify fields for extracting data from the article page
'name' : 'MetaTitle',
'type' : 'text',
'selector' : {
'element' : 'title'
}
}, {
'name' : 'MetaDescription',
'type' : 'text',
'selector' : {
'element' : 'meta[name="description"]',
'attribute' : 'content',
}
}, {
'name' : 'Image',
'type' : 'text',
'selector' : {
'element' : 'meta[property="og:image"]',
'attribute' : 'content',
}
}, {
'name' : 'Gallery',
'type' : 'text',
'selector' : {
'parent' : '#gal_img',
'element' : 'a',
'attribute' : 'data-original',
}
}, {
'name' : 'Title',
'type' : 'text',
'selector' : {
'parent' : 'h1',
'element' : '.fn'
}
}, {
'name' : 'Telephone',
'type' : 'text',
'selector' : {
'parent' : '#comp-contact',
'element' : '.telCntct > a.tel'
}
}, {
'name' : 'Mobile',
'type' : 'text',
'selector' : {
'parent' : '#mob_set',
'element' : '.telCntct'
}
}, {
'name' : 'Address',
'type' : 'text',
'selector' : {
'element' : '#fulladdress > span'
}
}, {
'name' : 'YearEstablished',
'type' : 'text',
'selector' : {
'parent' : '.alstdul:nth-of-type(-1)',
'element' : 'li'
}
}, {
'name' : 'Website',
'type' : 'text',
'selector' : {
'parent' : '.mreinfp:nth-of-type(1)',
'element' : 'a',
'attribute' : 'title'
}
}, {
'name' : 'Business Info',
'type' : 'multiple',
'selector' : {
'element' : '.businfo '
},
'fields' : [{
'name' : 'Business Information',
'type' : 'text',
'selector' : {
'element' : '.detl'
}
}, {
'name' : 'Service Offered',
'type' : 'text',
'selector' : {
'element' : 'p:nth-of-type(-1)',
}
}]
}, {
'name' : 'OperationTiming',
'type' : 'multiple',
'selector' : {
'parent' : '#statHr',
'element' : '.mreinfli'
},
'fields' : [{
'name' : 'Day',
'type' : 'text',
'selector' : {
'element' : '.mreinflispn1'
}
}, {
'name' : 'Time',
'type' : 'text',
'selector' : {
'element' : '.mreinflispn2'
}
}]
}, {
'name' : 'Rating',
'type' : 'multiple',
'selector' : {
'element' : '.rtngsval'
},
'fields' : [{
'name' : 'Votes',
'type' : 'text',
'selector' : {
'element' : '.votes'
}
}, {
'name' : 'Rating',
'type' : 'text',
'selector' : {
'element' : '.value-title',
'attribute' : 'title'
}
}]
}]
}