Downloading processed HTML of PHP page


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Downloading processed HTML of PHP page
# 1  
Old 11-27-2012
Downloading processed HTML of PHP page

Hi,

I am trying to obtain the HTML code of a PHP page (http:// areferee .com/soccer/test1.php?quiz=50&ran=1&t=5) after the page has been processed; I want pure HTML. Is there a Unix command I can use to do this? I have tried wget, GET, curl but I am getting odd behaviour i.e. it is not completing successfully.
To do this manually, I open this webpage in IE, right-click, View Source and voila I have it. In Chrome and Firefox, it shows me the source code of the page with PHP code.

Is there an alternative?
# 2  
Old 11-27-2012
Do you have lwp-download?
Code:
lwp-download "http://areferee.com/soccer/test1.php?quiz=50&ran=1&t=5" download.html

This User Gave Thanks to Yoda For This Post:
# 3  
Old 11-27-2012
That's perfect! Thanks.
# 4  
Old 11-27-2012
Quote:
Originally Posted by djcas
I am trying to obtain the HTML code of a PHP page (http:// areferee .com/soccer/test1.php?quiz=50&ran=1&t=5) after the page has been processed; I want pure HTML. Is there a Unix command I can use to do this? I have tried wget, GET, curl but I am getting odd behaviour i.e. it is not completing successfully.
It's probably due to the & in the URL. The shell will treat it as separate commands, wget LAWS OF THE GAME TEST and ran=1 and t=5. If you want the shell to not split on & like that, you must put the string in double-quotes " ".

IOW, I think it's the quotes that fixed it, not lwp-download...
# 5  
Old 11-27-2012
Any idea what is wrong with this command in bash?

`lwp-download "http://areferee.com/soccer/test.php?quiz=50&ran=1&t=1" test.html`

I'm sure I'm not escaping or something of the sort.
# 6  
Old 11-27-2012
Why are you using back-ticks?

if you just want to run the command, then:-
Code:
lwp-download "http://areferee.com/soccer/test1.php?quiz=50&ran=1&t=5" test.html

Or if you want to get the downloaded size, then:-
Code:
d_size=$( lwp-download "http://areferee.com/soccer/test1.php?quiz=50&ran=1&t=5" test.html )

# 7  
Old 11-27-2012
You were right about the quotes! Silly mistake...

---------- Post updated at 05:28 PM ---------- Previous update was at 05:27 PM ----------

I'm trying to run it in a loop in a bash script so I can iterate the querystring parameter t.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Accessing the html page

Hi All, In our unix server we have an apache web server running. Now, I want to create my own webpage. Therefore I created webpage at /export/home/test.html file. Where do I need to place this file and what do I need mention this page in my web browser to access it. Without apache... (1 Reply)
Discussion started by: Arasu
1 Replies

2. Shell Programming and Scripting

Monitoring an html web page changes

Hello, I need to monitor an html web page for ANY changes and should be able to know if it's modified or not (since last query). I do not need what modifications but just notification is enough. This is a simple web page and I don't need to parse the links any further. Is it possible to do... (10 Replies)
Discussion started by: prvnrk
10 Replies

3. Shell Programming and Scripting

Attached HTML page to Email

Greeting all, Not sure anyone tested to send out email with HTML page as attachment from Shell Script ? I know if I use uuencode file.html approach, the mail receive in attachment is empty. So I guess uuencode cannot be use for the html code. Appreciate if anyone can share the code to... (0 Replies)
Discussion started by: ckwan
0 Replies

4. Shell Programming and Scripting

How to extract url from html page?

for example, I have an html file, contain <a href="http://awebsite" id="awebsite" class="first">website</a>and sometime a line contains more then one link, for example <a href="http://awebsite" id="awebsite" class="first">website</a><a href="http://bwebsite" id="bwebsite"... (36 Replies)
Discussion started by: 14th
36 Replies

5. Red Hat

Publishing HTML Page

Hi All, Thanks for reading. I am not sure if I am asking this in the correct group. But here it goes: There is a shell script which does some system checks and creates an html file called system_summary.html on my Red Hat machine say in /reports directory every hour. Now I want to view it... (6 Replies)
Discussion started by: deepakgang
6 Replies

6. UNIX for Dummies Questions & Answers

Publishing HTML Page

Hi All, Thanks for reading. I am not sure if I am asking this in the correct group. But here it goes: There is a shell script which does some system checks and creates an html file called system_summary.html on my Red Hat machine say in /reports directory every hour. Now I want to view it... (1 Reply)
Discussion started by: deepakgang
1 Replies

7. Web Development

How to auto update html page

is there any way to auto update html page. I created html page entry.html, whenever i change in html script i need to refresh my page. If not in html, can we do this in any other language and how? (2 Replies)
Discussion started by: RohitKJ
2 Replies

8. Web Development

findstr in html page

I am planning to create an html page that will count number of connected ports, challenge for me is how to put it in a page. Thanks! (1 Reply)
Discussion started by: webmunkey23
1 Replies

9. UNIX for Dummies Questions & Answers

Accessing a HTML page

Hi All, In our unix server we have an apache web server running. I can access the default apache web page from my windows machine. Now, I want to create my own webpage. Therefore I created webpage at /export/home/myname/test.html file. Where do I need to place this file and what do I need... (2 Replies)
Discussion started by: pkm_oec
2 Replies

10. Solaris

Accessing a HTML page

Hi All, In our unix server we have an apache web server running. I can access the default apache web page from my windows machine. Now, I want to create my own webpage. Therefore I created webpage at /export/home/myname/test.html file. Where do I need to place this file and what do I need... (0 Replies)
Discussion started by: pkm_oec
0 Replies
Login or Register to Ask a Question