0

I am trying to automate PDF by its URL and my code is:

var http = require('http');
var fs = require('fs');

browser.getAllWindowHandles().then(function(handles) {
    browser.switchTo().window(handles[1]);
    console.log(handles[1]);
    browser.driver.getCurrentUrl().then(function(url) {
        console.log(url);

        var file = fs.createWriteStream(url);
        console.log(file);
        var request = http.get(url, function(response) {
            response.pipe(file);
        });
    });
})

I am getting error:

Protocol "blob:" not supported. Expected "http:".

Anyone can help with this issue?

Infern0
  • 2,565
  • 1
  • 8
  • 21
ajinkya
  • 31
  • 6

0 Answers0