1

Due to poor internal company system, I need to do the same data entry again and again. I was wondering if I could make my life easier by writing a script?

I need to capture text (certain paragraphs or data in table) from a web page and save it as a .txt file. I am thinking of trying to do this by using a bookmarklet with some javascript code.

  1. How do I save the text that I need as .txt using bookmarklet/javascript?

  2. document.getElementById("someDiv").innerHTML would also give me all the html code but than I need to spend a lot of time cleaning it up later. .innerText looks like something much better but based on what I have read this is not recommended?

Thanks

  • Not sure what your actual question is -- is it about innerHTML vs innerText, or about writing a script to save content as a txt file? Maybe you can post some code for what you have already tried. – Soren Mar 30 '16 at 16:10
  • 2
    `textContent` is valid property if you want to get text without html tags. For file saving read http://stackoverflow.com/questions/13405129/javascript-create-and-save-file – weaknespase Mar 30 '16 at 16:17

1 Answers1

0

I think I may have found something that could be helpful: link

The only other idea I have is to write to the console with console.log(), then copy and paste it to where you need it.

  • Link only answers are a bad idea since the link may become invalid over time -- I would upvote if you had summarized the content of the link – Soren Mar 30 '16 at 16:43