Skip to content

Commit

Permalink
Create main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Base committed Jun 22, 2019
1 parent 99301fc commit d9ad0d2
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,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(/مسير:&nbsp;\<b\>([^<]*)&nbsp;به&nbsp;([^<]*)\<\/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]);
}
}

0 comments on commit d9ad0d2

Please sign in to comment.