How to create a session in axios

I am trying to log in to a website using forms data payload. It requires a _csrf token which is uniquely generated every time the login page opens up. I was trying to get to the login page to take the _csrf id then post the payload in the very same session.

My python code was able to do it with requests.session() but I am having trouble with axios.

My python code

login = {'_csrf': 0, 'email': '[email protected]', 'password': "password"}
with requests.Session() as s:
    url = "https://example.com/login.html"
    res = s.get(url, headers={'User-Agent': 'Mozilla/5.0'})
    soupy = soup(res.content, 'html.parser')
    _csrf = soupy.find('meta', attrs={'name': "csrf-token"})['content']
    login['_csrf'] = _csrf
    res = s.post(url, data=login, headers={'User-Agent': 'Mozilla/5.0'}

My Node.js Code

var url = "https://example.com/login.html";
let response = await axios.get(url,{
    headers:{
       'User-Agent': 'Mozilla/5.0'
    }
})
.then(function(response){
    let soup = cheerio.load(response.data, null, false);
    var _csrf = soup('meta[name="csrf-token"]').attr('content');
    var login = {'_csrf': _csrf, 'email': '[email protected]', 'password': "password"};
    response = axios.post(url,{
        headers:{
            'User-Agent': 'Mozilla/5.0'
        },
        data: login,
    }).catch((e)=> {console.log(e)});
    console.log(response.data);
});

but it doesn’t work as I get a _csrf mismatch error. What can I do to get axios work in a session?