-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.js
63 lines (63 loc) · 1.89 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
/**
*
* @Name : PlaneTicketFirefox/main.js
* @Version : 1.0
* @Programmer : Max
* @Date : 2019-06-23
* @Released under : https://github.com/BaseMax/PlaneTicketFirefox/blob/master/LICENSE
* @Repository : https://github.com/BaseMax/PlaneTicketFirefox
*
**/
document.body.style.border = "25px solid yellow";
let lb=document.querySelectorAll("table tr td input[readonly=readonly]");
console.log(lb[0].value);
console.log(lb[1].value);
let code=document.querySelector("body").innerHTML;
let matches = code.match(/مسير: \<b\>([^<]*) به ([^<]*)\<\/b\>/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
console.log(matches[2]);
}
let matches = code.match(/تاريخ: <b>\s*([^<]*)\<\/b\>/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
}
let matches = code.match(/خروج:\s*([^\n]*)/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
}
let matches = code.match(/ورود:\s*([^\n]*)/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
}
let matches = code.match(/ماره پرواز:\s*([^\n]*)/);
// console.log(matches);
if(matches) {
console.log(matches[1]);
}
let 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]);
}
let 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]);
let 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]);
}
}