npm install --save student-api
Đây là một ví dụ cào dữ liệu từ TLU.
const StudentAPI = require("student-api");
(async () => {
const config = {
baseURL: "http://dkh.tlu.edu.vn",
};
const api = new StudentAPI();
api.config(config);
await api.login({ idUser: "xxx", passwordUser: "xxx" });
await api.close();
})();
Type: function config (opts)
opts
Object Options (optional, default{}
)opts.baseURL
: Địa chỉ web trường bạn (Bắt buộc phải có)opts.browser
Object? Puppeteer browser instance to useopts.puppeteer
Object? Puppeteer launch options
Kiểm tra đăng nhập thành công hay không ?
Type: boolean
Trả về user đã đăng nhập thành công
Type: Object
Khởi chạy browser headless.
Type: function ()
Đăng nhập tự động.
Type: function (user): Promise
Trả về lịch học theo kì
Type: Array
Trả về lịch học mới đăng kí
Type: Array
Trả về lịch học được nhóm theo ngày
Type: Array
Trả về lịch học được nhóm theo ngày
{terms : ... , listMarks : ..., totals : ...}
Type: Object
Closes the underlying browser instance, effectively ending this session.
Type: function (): Promise
- puppeteer - Headless Chrome Node API.
MIT © 2KSOFT
Support my OSS work by following me on github following me on facebook