Last active
August 1, 2019 14:41
-
-
Save namhnz/5e1df239f80d92276e414b186edba150 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printTrBaiHoc(){ | |
//Ví dụ trang: https://moon.vn/chuyen-de/ham-so-3017 | |
//Copy nội dung của hàm paste vào F12 console để tạo | |
Array.from(document.querySelectorAll("#ContentPlaceHolder1_Panel1 > table > tbody > tr")) | |
.forEach(tr => { | |
let tenBaiHoc = tr.querySelector("td:nth-child(3) > a").title.trim(); | |
let daXuatBan = tr.querySelector("td:nth-child(4) > div") == null; | |
if(daXuatBan){ | |
console.log(`<tr><td>${tenBaiHoc}</td><td><a href="" target="_blank" class="btn btn-primary">Vào học</a></td></tr>`) | |
} else { | |
console.log(`<tr><td>${tenBaiHoc}</td><td><a class="btn btn-primary" disabled="" href="https://www.blogger.com/blogger.g?blogID=1212524714822142927#!"><i class="fa fa-spinner fa-spin "></i> Đang xuất bản</a></td></tr>`); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment