Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // knigindom.ru book loader
- function load(book = 0, page = 1, text = '') {
- console.log('Loading ' + page + ' page')
- $.get('/read/?book='+ book + '&page=' + page, function(data) {
- console.log('Page ' + page + ' loaded')
- let next = parseInt($(data).find('.readlink').last().attr('href').split('=').slice(-1)[0]);
- text += '\n' + $(data).find('#bookread').text();
- if (next > page) {
- load(book, next, text);
- } else {
- console.log(text);
- }
- });
- }
- load(999);
- // 999 - book id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement