LOL, well, what you are talking about is really called “scraping”. You scrape a webpage and save it after you adjust the script the way you want it. Such as removing scripts.
This can be done with simple text replacement functions built into PHP. But, you can not doe it easy with the way you are discussing. For this, you would need to create a macro to do it. You can Google Netbeans Macros and learn how to do it. It would be tricky though.
It might be best to just write a simple script to do this instead. I have tons of scraping experience. It is easy.
You would need to have one input for the website you want to save. You would enter the URL and run a
simple script to load that page into a variable. Then, have it locate all of the JS scripts and remove them.
And. lastly, have it save the script in a folder or force it to download to you. This can be done in just a few
lines of code.
If you want to do this, I can help you. Quickly a few ideas to start you off…
To load an entire website page into a variable…
$webpage = file_get_contents($url);
That’s it! How easy can that be? You would of course need to input the webpage and use that instead.
$script_start_pos = strpos($webpage, "<script>");
$script_end_pos = strpos($webpage, "</script>", $script_start_pos);
$webpage = substr($webpage, 0, $script_start_pos) . $substr($webpage, $script_end_pos+9);
This will locate the start of the first script tag. Then, locate the end of that tag. Then, it removes it.
It is removed by taking the page up to the start of the tag and add the page after the end of the tag.
( Just off the top of my head, not really tested. ) Hope this gives you a starting place…
You could write a PHP script to do this for all files in a folder. It would basically use GLOB() function to go thru each filename in the folder and then remove the scripts from each of them.
But, if you want to do it with macro’s there are a lot of ways to do that. I think in ATOM, you can set up a macro and that you can use preg_replace() function to remove everything between tags. I do not use ATOM, so not really sure how to code it. You might ask on the ATOM forum about how to handle it.