I want to save 1 image in my local website. I'll research all internet, I find almost is C# and Java code but I can't convert it to Javascrip.
Almost example using Point
, IO
library is not available in javascript.
I also search code in nodejs in Stackoverflow.
I've was test but it not working for me.
Present,
My code can Takescreenshot
all webpage but I want it capture image with id.
Here is code:
driver.findElement(webdriver.By.xpath('//img[@id="c_pages_Image"]'))
.then(function(){
driver.takeScreenshot("c:\\selenium_local_map\\out1.png");
});
driver.takeScreenshot().then(function(data){
var base64Data = data.replace(/^data:image\/png;base64,/,"")
fs.writeFile("out.png", base64Data, 'base64', function(err) {
if(err) console.log(err);
});
});