i want to take screenshot of django active page's elements. I research about selenium and playwright but they opening the pages on new browser. The page on which I want to take the screenshot has dynamic information and it is constantly changing, so it is not appropriate to take a screenshot by opening it on a new page. Each user will enter different information on the opened page and take a screenshot of the relevant element.
Here want i want to do;
1- Take screenshot of div with JS(OK)
2- Send POST Request to django url with JS to PYTHON(Need help -,- )
3- And send this image to slack(OK)
capturing div via html2canvas;
function capture() {
html2canvas(document.getElementById("main"), {
letterRendering: 1,
allowTaint: true,
useCORS: true,
})
.then(function (canvas) {
document.getElementById("result").src = canvas.toDataURL("image/png", 0.5);
})
.catch((e) => {
alert(e);
});
}