I'm trying to access promise value which I return from JavaScript function. When I try to return it in selenium it returns None. My function works and I can print responseData in console.log. I just struggle with accessing it in python. Is there any way to do it ?
js_value = self.driver.execute_script("""
var request = "";
async function final(){
await send("POST", "https://www.thecrims.com/login",data).then((responseData)=>{
request = responseData
});
};
return request;
""")
time.sleep(3)
print(js_value)