Not able to load scraped data on heroku while it works fine on localhost

I tried building a lyrics website (for a test purpose) and for the lyrics part, I scraped the data from azLyrics and tried to res.render the data on my website through index.hbs. It worked fine on the local host, I was able to get the lyrics however when I deployed on Heroku, the scraping part didn’t work.

Here is my code:

app.js

const express = require('express');
const path = require('path');
const hbs = require('hbs');
const bodyParser = require('body-parser');
const lyricsClass = require('./assets/partials/lyricsparser');
const state={};

 
const app=express();

const port = process.env.PORT || 5000;
const dirname= path.join(__dirname,'/assets/views/hbs');
const partialPath=path.join(__dirname,'/assets/partials');


app.set('view engine','hbs')
app.set('views', dirname);
hbs.registerPartials(partialPath);
app.use(bodyParser.urlencoded({extended:true}));

app.use('/',(req,res,next)=>{
    console.log('Hello');
    next();
});

app.use(express.static(path.join(__dirname,'/assets')));

app.get('/', (req, res) => {
   res.render('index')
});

app.use('/search',(req,res,next)=>{
    console.log('app.send works fine')
    next();
})
app.post('/search', (req, res) => {
    ;(async function(){
    const newText = req.body.data.replace(/ /g, "").toLowerCase();
    const newTextData=newText.split(',')
    state.search=new lyricsClass.hello(newTextData[0],newTextData[1]);
    await state.search.getLyricss();
   res.render('lyrics',{
       lyrics:state.search.lyrics
   })
    })();   
});

and the lyricsparser.js

const axios = require('axios')
class hello{
    constructor(singer,song){
        this.singer=singer;
        this.song=song;
    }
   async getLyricss(){
    try{
        const data=await axios(`https://www.azlyrics.com/lyrics/${this.singer}/${this.song}.html`);
        this.dataElement=data.data;
        this.lyrics=this.dataElement.split('<div>')[1].split('</div>')[0];

    }
    catch(error){
        this.lyrics=error;
    }
   }
}

module.exports.hello=hello;

Just to simplify the codes, In lyricsparser.js , I made a class called hello and passed singer name and song name through an object created in the app.js . state.search=new lyricsClass.hello(newTextData[0],newTextData[1]) , here state is an empty object… The newTextData actualy stores the data taken from my website’s search field and modifies according to the azlyrics url structure(which is like “https://www.azlyrics.com/lyrics/singernamewithoutspace/songnamewithoutspace.html”). And then after creating the object I can easily access the method getLyricss which actually scrapes the data and then stores it to this.lyrics and I can access that lyrics through the object state.search . It works fine on localhost but when uploaded to heroku, it gives an Error: Request failed with status code 403 .