Computing.Net > Forums > Networking > batch file to generate html page

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch file to generate html page

Reply to Message Icon

Name: carlos valmont
Date: August 9, 2008 at 18:52:34 Pacific
OS: xp
CPU/Ram: 2gb
Comment:

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..



Sponsored Link
Ads by Google

Response Number 1
Name: guapo
Date: August 9, 2008 at 19:36:17 Pacific
Reply:

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.


0

Response Number 2
Name: FishMonger
Date: August 10, 2008 at 15:55:39 Pacific
Reply:

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.


0

Response Number 3
Name: carlos valmont
Date: August 10, 2008 at 18:38:30 Pacific
Reply:

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..


0

Response Number 4
Name: FishMonger
Date: August 10, 2008 at 23:36:58 Pacific
Reply:

Here's an example of a simple Perl script.


#!/usr/bin/perl

use 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...


0

Response Number 5
Name: carlos valmont
Date: August 15, 2008 at 08:07:14 Pacific
Reply:

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


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Networking Forum Home


Sponsored links

Ads by Google


Results for: batch file to generate html page

Batch files to connect and disconnect to other computers www.computing.net/answers/networking/batch-files-to-connect-and-disconnect-to-other-computers/919.html

Batch File to check operating system www.computing.net/answers/networking/batch-file-to-check-operating-system/1738.html

Batch File to Configure DNS Suffix www.computing.net/answers/networking/batch-file-to-configure-dns-suffix/25243.html