0

To open https://www.yahoo.com/ in chrome ,and to click input--console

var as=document.getElementsByTagName('a');
for(var i=0;i<as.length;i++){
     console.log(as[i]);
 }

Now all the 132 anchor elements showed in chrome's console,how to save the parsed anchor elements in local file with js ?

showkey
  • 482
  • 42
  • 140
  • 295
  • Due to browser restrictions I don't believe you can write to disk from the browser. Someone may correct me if I'm wrong, but I believe your best bet would be to create some type of link that allows a user to download the data. – user2263572 Oct 04 '16 at 03:06
  • It's not possible to save the file in your server, directly from JavaScript, since that would cause **massive security problems**. You will have to **use a server-side language** for that or you can use **`Blob`** and when you're done provide a download link. – Angel Politis Oct 04 '16 at 03:08
  • use `blob` then append the every thing on `blob` .finally download it. – Karthikeyan Sekar Oct 04 '16 at 03:08
  • Read this post http://stackoverflow.com/questions/582268/read-write-to-file-using-jquery – Moshe Arad Oct 04 '16 at 03:16

0 Answers0