CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
source code

 



cypher_MS
Novice

Aug 19, 2002, 11:10 PM

Post #1 of 4 (470 views)
source code Can't Post

Is there a way to copy the source code of a web-page (html page) and write it to a txt file. For example, if I were to activate the script, I would need it to copy a particular .html page's source code, and write it to a txt file, as plain text.
---
C:\Dos
C:\Dos\Run
Run Dos Run
---


davorg
Thaumaturge / Moderator

Aug 20, 2002, 12:52 AM

Post #2 of 4 (468 views)
Re: [cypher_MS] source code [In reply to] Can't Post

Well you can get the source of a page really easily

Code
#!/usr/bin/perl -w 

use strict;
use LWP::Simple;

getstore('http://www.somewhere.com/some_page.html', 'some_page.html');


But if by "plain text", you mean that you want to remove all of the HTML tags, then you should look at the HTML::Parser module.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


cypher_MS
Novice

Aug 20, 2002, 6:57 PM

Post #3 of 4 (462 views)
Re: [davorg] source code [In reply to] Can't Post

How would I write that to a file now?
---
C:\Dos
C:\Dos\Run
Run Dos Run
---


cypher_MS
Novice

Aug 20, 2002, 7:28 PM

Post #4 of 4 (460 views)
Re: [cypher_MS] source code [In reply to] Can't Post

Disregard my last Post. I've figured it out, thank you very much!
---
C:\Dos
C:\Dos\Run
Run Dos Run
---

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives