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

    pretty.logPrint("Retrieving novel cover image...");

    try{

        // Image CSS selector for novel image goes here
        let image = $(selector).attr('src');

        pretty.logPrint("Sucessfully retrieved novel cover image.");
        return image;

    }catch(err){
        
        if(retries>0){

            errDict.getError(6);
            errDict.customError(err.message);
            pretty.logPrint(`Retrying to retrieve novel cover image... (Retries left: ${retries-1})`);
            return retrieveNovelImage(HTML,selector,retries-1);
        }
        else{
            errDict.getError(7);
            return null;
        }
        
    }
    
}
/**
 * Retrieves the source link of the novel image.
 * 
 * @param {String} HTML The Novel Page HTML body retrieved from the request package
 * @param {String} selector The set of string CSS selector for the novel image
 * @param {Number} retries This is the maximum number of retries till error gets thrown
 * 
 * @returns The source link of the novel image, null if error or does not exist.
 */
Retrieves the source link of the novel image.

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

@returns The source link of the novel image, null if error or does not exist.
Retrieves the source link of the novel image . @param { String } HTML The Novel Page HTML body retrieved from the request package @param { String } selector The set of string CSS selector for the novel image @param { Number } retries This is the maximum number of retries till error gets thrown @returns The source link of the novel image null if error or does not exist .
function retrieveNovelImage(HTML, selector, retries){
    const $ = cheerio.load(HTML);
    pretty.logPrint("Retrieving novel cover image...");
    try{
        let image = $(selector).attr('src');
        pretty.logPrint("Sucessfully retrieved novel cover image.");
        return image;
    }catch(err){
        if(retries>0){
            errDict.getError(6);
            errDict.customError(err.message);
            pretty.logPrint(`Retrying to retrieve novel cover image... (Retries left: ${retries-1})`);
            return retrieveNovelImage(HTML,selector,retries-1);
        }
        else{
            errDict.getError(7);
            return null;
        }
    }
}
function retrieveNovelImage ( HTML , selector , retries ) { const $ = cheerio . load ( HTML ) ; pretty . logPrint ( "Retrieving novel cover image..." ) ; try { let image = $ ( selector ) . attr ( 'src' ) ; pretty . logPrint ( "Sucessfully retrieved novel cover image." ) ; return image ; } catch ( err ) { if ( retries > 0 ) { errDict . getError ( 6 ) ; errDict . customError ( err . message ) ; pretty . logPrint ( ` ${ retries - 1 } ` ) ; return retrieveNovelImage ( HTML , selector , retries - 1 ) ; } else { errDict . getError ( 7 ) ; return null ; } } }
Retrieves the source link of the novel image.
Retrieves the source link of the novel image .
// Image CSS selector for novel image goes here