Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello everybody
I got a big list of urls formated like this :
"http://www.mywebsite.com";"bla bla bla bla" so i want to process batch with script for example : "http://www.mywebsite.com";"bla bla bla bla" i want the script open each url on the list and save it as html(with the source code) with the first 3/4 words of the description the result will be something like this >>> bla-bla-bla.html or other way maybe extract the source code of each url and save as html with the name of the description wait your good news .ps: if you need file example just contact me.
thank for help a newbie..

The fetch command in Unix will get the URL and save it to a file. I don't know how you would do that in Windows.

Retrieving the web pages is easy with the wget utility.
http://gnuwin32.sourceforge.net/pac...
Your description for how you want to name the files is not very clear. Are you saying that you need to parse each file and extract a portion of the description meta tag and use it as part of the filename? If so, then you'll need to first save the file with its default name, then do your parsing and rename the file.
This type of task is very easily done in Perl, or Python, or VB, but can get messy and difficult with a batch file.

Hi FishMonger
yes i need to parse each file and extract a portion of the description meta tag and use it as part of the filename
problem i never code don't know perl
maybe i can learn tutorial..

Here's an example of a simple Perl script.
#!/usr/bin/perluse strict;
use warnings;
use LWP::Simple;
use HTML::HeadParser;my $content = get("http://www.computing.net/answers/networking/batch-file-to-generate-html-page-/33964.html");
my $parser = HTML::HeadParser->new;
$parser->parse($content);my $description = $parser->header('x-meta-description');
print $description;================================================================
Here's what it outputs:Hello everybody I got a big list of urls formated like this : http://www.mywebsite.com;bla bla bla bla so i want to process batch with script for example : http://www.mywebs...

Hi FishMonger
I have try the example code but i think my server have not activated perl script
php script is ok
just need to open url and save it
thank you

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |