-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.js
75 lines (75 loc) · 2.24 KB
/
main.js
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
/**
*
* @Name : PlaneTicketFirefox/main.js
* @Version : 1.0
* @Programmer : Max
* @Date : 2019-06-23, 2019-06-25
* @Released under : https://github.com/BaseMax/PlaneTicketFirefox/blob/master/LICENSE
* @Repository : https://github.com/BaseMax/PlaneTicketFirefox
*
**/
document.body.style.border = "25px solid yellow";
if(document) {
if(document.body) {
document.body.style.border = "25px solid yellow";
}
if(document.querySelectorAll && document.querySelector) {
var lb=document.querySelectorAll("table tr td input[readonly=readonly]");
if(lb && lb[0] && lb[1]) {
console.log(lb[0].value);
console.log(lb[1].value);
}
let code=document.querySelector("body");
if(code) {
code=code.innerHTML;
let matches = code.match(/مسير: \<b\>([^<]*) به ([^<]*)\<\/b\>/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
console.log(matches[2]);
}
matches = code.match(/تاريخ: <b>\s*([^<]*)\<\/b\>/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
}
matches = code.match(/خروج:\s*([^\n]*)/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
}
matches = code.match(/ورود:\s*([^\n]*)/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
}
matches = code.match(/ماره پرواز:\s*([^\n]*)/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
}
matches = code.match(/قابل پرداخت\s*\<\/td\>\s*\<td style\=\"text-align: right; font-weight: bold;\"\>\s*([^\n]*)/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
}
lb=document.querySelectorAll("table.Table01 tr");
// console.log(lb);
for(let index=4; index<lb.length;index++) {
let content=lb[index].innerHTML;
if(content.includes('<table class="Table02" border="0">')) {
break;
}
// console.log(lb[index]);
matches = content.match(/\<td\>\s*\<span[^\>]+\>([^\<]*)\<\/span\>\s*\<\/td\>\s*\<td\>\s*([^\n]*)\s*\<\/td\>\s*\<td\>\s*([^\n]*)\s*\<\/td\>\s*\<td\>\s*([^\n]*)\s*\<\/td\>/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
console.log(matches[2]);
console.log(matches[3]);
console.log(matches[4]);
}
}
}
}
}