Using jQuery, I think the simplest and fastest method would be something like this:
- Use a jQuery AJAX request to get the contents of that web page.
- Use regex to get the contents within the
<body>
tags.- Regex will only work if you know for sure that every page has an opening and closing body tag that is properly formatted. If you can't ensure this, you'll need to crawl the DOM instead.
- Put the ripped content in to a new jQuery object:
var $contents = $(bodyContents)
- Use typical jQuery functions to find what you need:
$contents.find('small').text()
- Write the value to the file.
It'd be a rather substantial amount of code to do all that, so I'm not going to try.
Also, for writing the file, unless you are in certain environments, you can't write the file with JavaScript (at least not with the technologies you've tagged), so you'll need a method for that. Some options for that:
- Send an AJAX call to a server where it can store it.
- Run the script as a Node script which can access the file system.
- Use something like the HTML 5 Local Storage: http://diveintohtml5.info/storage.html
Good luck.