function retrieveNovelChapterTableMaxRow(HTML, selector, retries){
    const $ = cheerio.load(HTML);

    pretty.logPrint("Retrieving chapter table max rows...");

    try{

        // Get the 5th child element or 3rd anchor child element from class
        // digg_pagination in the table; it's usually where the max page is located.
        let rows = $(selector).get().length;

        return parseInt(rows);
    }catch(err){

        if(retries>0){
            
            errDict.getError(14);
            errDict.customError(err.message);
            pretty.logPrint(`Retrying to max page of chapter table... (Retries left: ${retries-1})`);
            return retrieveNovelChapterTableMaxPage(HTML,selector,retries-1);
        }
        else{
            errDict.getError(15);
            return null;
        }
    }

}
/**
 * Retrieves the max row number of the chapter table of the novel.
 * 
 * @param {String} HTML The Novel Page HTML body retrieved from the request package
 * @param {String} selector The set of string CSS selector for the table rows
 * @param {Number} retries This is the maximum number of retries till error gets thrown
 * 
 * @returns The max row of the chapter table, null if error or does not exist.
 */
Retrieves the max row number of the chapter table of the novel.

@param {String} HTML The Novel Page HTML body retrieved from the request package
@param {String} selector The set of string CSS selector for the table rows
@param {Number} retries This is the maximum number of retries till error gets thrown

@returns The max row of the chapter table, null if error or does not exist.
Retrieves the max row number of the chapter table of the novel . @param { String } HTML The Novel Page HTML body retrieved from the request package @param { String } selector The set of string CSS selector for the table rows @param { Number } retries This is the maximum number of retries till error gets thrown @returns The max row of the chapter table null if error or does not exist .
function retrieveNovelChapterTableMaxRow(HTML, selector, retries){
    const $ = cheerio.load(HTML);
    pretty.logPrint("Retrieving chapter table max rows...");
    try{
        let rows = $(selector).get().length;
        return parseInt(rows);
    }catch(err){
        if(retries>0){
            errDict.getError(14);
            errDict.customError(err.message);
            pretty.logPrint(`Retrying to max page of chapter table... (Retries left: ${retries-1})`);
            return retrieveNovelChapterTableMaxPage(HTML,selector,retries-1);
        }
        else{
            errDict.getError(15);
            return null;
        }
    }
}
function retrieveNovelChapterTableMaxRow ( HTML , selector , retries ) { const $ = cheerio . load ( HTML ) ; pretty . logPrint ( "Retrieving chapter table max rows..." ) ; try { let rows = $ ( selector ) . get ( ) . length ; return parseInt ( rows ) ; } catch ( err ) { if ( retries > 0 ) { errDict . getError ( 14 ) ; errDict . customError ( err . message ) ; pretty . logPrint ( ` ${ retries - 1 } ` ) ; return retrieveNovelChapterTableMaxPage ( HTML , selector , retries - 1 ) ; } else { errDict . getError ( 15 ) ; return null ; } } }
Retrieves the max row number of the chapter table of the novel.
Retrieves the max row number of the chapter table of the novel .
// Get the 5th child element or 3rd anchor child element from class // digg_pagination in the table; it's usually where the max page is located.