Visit Our UNIX and Linux User Community


Perl script to copy contents of a web page


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl script to copy contents of a web page
# 1  
Old 09-07-2009
Bug Perl script to copy contents of a web page

Hi All,

Sorry to ask this question and i am not sure whether it is possible. please reply to my question. Thanks in advance.

I need a perl script ( or any linux compatible scripts ) to copy the graphical contents of the webpage to a word pad.

Say for example, i have a documentation site with 20 pages, i need to copy the contents of these 20 webpage document to single word file.

My requirement can be done manually by ctrl+A, ctrl+C ( on webpage P ) and ctrl+V ( on word document ). For 20 pages manual process can be done, think for 50+ pages or more.


Thanks in advance.....SmilieSmilieSmilieSmilieSmilie
# 2  
Old 09-07-2009
Did you check for lynx, curl ?
# 3  
Old 09-07-2009
You may take a look at the curl command.
Simple usage :
Code:
curl http://www.somesite.com/

# 4  
Old 09-07-2009
Quote:
Originally Posted by thanhdat
You may take a look at the curl command.
Simple usage :
Code:
curl http://www.somesite.com/

Hi thanhdat,

I am not looking for the source code of the web page. i need the graphical contents of the site. Sorry if i am wrong.
# 5  
Old 09-07-2009
Question: why do you need the visual content of a page (with 50+ printed pages) in a word processor document? If it's for offline reading, why not convert it to PDF? If it's for archiving, why not save the HTML source?
# 6  
Old 09-08-2009
Quote:
Originally Posted by pludi
Question: why do you need the visual content of a page (with 50+ printed pages) in a word processor document? If it's for offline reading, why not convert it to PDF? If it's for archiving, why not save the HTML source?
Answer: You are right Pludi. Redhat.com has some (70+) webpages which is purely documentation. These webpages are needed to me.

So, wats my question is, i need these webpages as a word document ( or pdf id fine) for printing. Instead of printing it by page by page, i need a script to copy these ( 70+ ) pages locally to my machine and print it.

This is the URL which i am try do so.

"http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.4/html/Logical_Volume_Manager_Administration/index.html"

Thanks in advance.
# 7  
Old 09-08-2009
Quote:
Originally Posted by anand.linux1984
[...]Instead of printing it by page by page, i need a script to copy these ( 70+ ) pages locally to my machine and print it.[...]
Erm, why? Open the page in any web browser, select File->Print, and off you go.
Or if you cannot print from the machine accessing the Internet but have CUPS available, there's CUPS-PDF

Previous Thread | Next Thread
Test Your Knowledge in Computers #282
Difficulty: Easy
Time-sharing operating systems schedule tasks for efficient use of the system and may also include accounting software for cost allocation of processor time, mass storage, printing, and other resources.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Refresh web page in bash script

hello, I am trying to refresh my web page which is created in bash script. I have a HTML page which when press a button calls a bash script. this bash script created the same page with dynamic data. When pressing the button I am calling to a function that set time out of 7 seconds and and after... (1 Reply)
Discussion started by: SH78
1 Replies

2. Shell Programming and Scripting

Copy text from web page and add to file

I need help to make a script for Ubuntu to OSCam that copy the text on this website that only contains "C: ip port randomUSERNAME password" and want to exclude the text "C:" and replace the rest with the old in my test.server file. (line 22) device = ip,port (line 23) user =... (6 Replies)
Discussion started by: baxarn
6 Replies

3. Shell Programming and Scripting

Random web page download wget script

Hi, I've been attempting to create a script that downloads web pages at random intervals to mimic typical user usage. However I'm struggling to link $url to the URL list and thus wget complains of a missing URL. Any ideas? Thanks #!/bin/sh #URL List url1="http://www.bbc.co.uk"... (14 Replies)
Discussion started by: shadyuk
14 Replies

4. HP-UX

Help running a unix script from a web page

First, let me state that I am completely out of my realm with this. I have a server running HPUX. I'm not even sure if this can be considered a UNIX question and for that let me apologize in advance. I need to create a web page where a client can input 2 variables (i.e. date and phone number).... (0 Replies)
Discussion started by: grinds
0 Replies

5. Shell Programming and Scripting

How to input a number in a web page and pass to a script?

I am working on an embedded linux router and trying to make a webpage where the user can input a desired number of CPE and have a script update that number on the router. I have a CLI where I can log in and type the following to change that number echo "20">/proc/net/dbrctl/maxcpe which then... (7 Replies)
Discussion started by: BobTheBulldog
7 Replies

6. Shell Programming and Scripting

Perl Script to find & copy words from Web.

I need to write a perl script to search for a specific set of numbers that occur after a series of words but before another. Specifically, I need to locate the phrase today at the summit, then immediately prior to the words tonnes/day copy the number that will be between 100 and 9,999, for example,... (1 Reply)
Discussion started by: libertyforall
1 Replies

7. Shell Programming and Scripting

how to redirect to a web-page by shell script

Dear all, I am calling a korn shell script(CGI script) by a web-page. This shell script do some checking in a unix file and return true or false. Now within the same script, If it returns true then I want to redirect to another web-page stored in htdocs directory. Example: Login page sends a... (3 Replies)
Discussion started by: ravi18s
3 Replies

8. Shell Programming and Scripting

PERL - copy fiel contents to array then compare against other file

Basically to illuminate i want to take a file with mutliple lines, C:\searching4theseletters.txt a b c Read this into an array @ARRAY and then use this to compare against another file C:\inputletters.txt b o a c n a (9 Replies)
Discussion started by: bradleykins
9 Replies

9. Shell Programming and Scripting

How to direct a script to a new web page after a script got completed?

Hi , I have a cgi code with shell script on it.I am submitting a form in the first.cgi.These values are posted to second.cgi.Second.cgi do some process with these values. After that i want to direct my page from second.cgi to first.cgi. What is the command i can use from cgi(shell) script? ... (2 Replies)
Discussion started by: rajbal
2 Replies

10. Shell Programming and Scripting

running shell script thru WEB page ....

....passing variable via list... here 's the HTML code extract : **************** <form method=post action=http://servername/cgi-bin/cgi-comptage_diff.ksh> <table border...........> .............. </table> <table bgcolor=#FFFFFF width="980"> ... (6 Replies)
Discussion started by: Nicol
6 Replies

Featured Tech Videos