catch the output of the URL


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting catch the output of the URL
# 1  
Old 03-13-2011
Bug catch the output of the URL

Hi all,

anybody can help me in this?

how to catch the output of the URL in scripting.
exmple:
if i give the URL:
https://www.unix.com/shell-programmin...#post302503291
then output should be in onefile newfile.txt

thanks in advance..
# 2  
Old 03-13-2011
try this
Code:
wget https://www.unix.com/shell-programming-scripting/155750-use-sed.html#post302503291 > newfile.txt

# 3  
Old 03-13-2011
Do u need the status of the url???
# 4  
Old 03-13-2011
Code:
wget -O newfile.txt "https://www.unix.com/shell-programming-scripting/155750-use-sed.html#post302503291"

Notes:
  1. It's better to quote the string to avoid bad interpretation by the shell.
  2. The "http://" is subsidiary for wget.
# 5  
Old 03-13-2011
Hi Homebo and frans,

i tried with your codes but it is throwong error.
wget https://www.unix.com/shell-programmin...#post302503291 > newfile.txt
error: wget: not found
wget -O newfile.txt "https://www.unix.com/shell-programmin...#post302503291"
error: wget: not found
# 6  
Old 03-13-2011
clearly,you need to install wget,if you use ubuntu,you can install it by
Code:
sudo apt-get install wget

Installation's similarly in other distributions.
# 7  
Old 03-13-2011
curl is another tool you can use to retrieve the contents of a URL.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting the output from url

Hi, I need to store the output of a url by passing parameters using shell script. For eg. Url: google.com and i am passing a parameter unix tutorial, then i need to store the output of that page somewhere. Could someone please help me to resolve this? Regards, Arasu. (1 Reply)
Discussion started by: Arasu123
1 Replies

2. Shell Programming and Scripting

Reading URL using Mechanize and dump all the contents of the URL to a file

Hello, Am very new to perl , please help me here !! I need help in reading a URL from command line using PERL:: Mechanize and needs all the contents from the URL to get into a file. below is the script which i have written so far , #!/usr/bin/perl use LWP::UserAgent; use... (2 Replies)
Discussion started by: scott_cog
2 Replies

3. UNIX for Dummies Questions & Answers

Awk: print all URL addresses between iframe tags without repeating an already printed URL

Here is what I have so far: find . -name "*php*" -or -name "*htm*" | xargs grep -i iframe | awk -F'"' '/<iframe*/{gsub(/.\*iframe>/,"\"");print $2}' Here is an example content of a PHP or HTM(HTML) file: <iframe src="http://ADDRESS_1/?click=5BBB08\" width=1 height=1... (18 Replies)
Discussion started by: striker4o
18 Replies

4. Programming

help with C try catch

can someone give me an example of try catch in C, everytime i do it under the main, i get some try undeclared error, and dont know how to fix it... (3 Replies)
Discussion started by: omega666
3 Replies

5. Web Development

Regex to rewrite URL to another URL based on HTTP_HOST?

I am trying to find a way to test some code, but I need to rewrite a specific URL only from a specific HTTP_HOST The call goes out to http://SUB.DOMAIN.COM/showAssignment/7bde10b45efdd7a97629ef2fe01f7303/jsmodule/Nevow.Athena The ID in the middle is always random due to the cookie. I... (5 Replies)
Discussion started by: EXT3FSCK
5 Replies

6. Shell Programming and Scripting

Unable to catch the output after core dump and bus error

I have a weird situation in which the binary dumps core and gives bus error. But before dumping the core and throwing the buss error, it gives some output. unfortunately I can't grep the output before core dump db2bfd -b test.bnd maxSect 15 Bus Error (core dumped) But if I do ... (4 Replies)
Discussion started by: rakeshou
4 Replies

7. UNIX for Dummies Questions & Answers

ReDirecting a URL to another URL - Linux

Hello, I need to redirect an existing URL, how can i do that? There's a current web address to a GUI that I have to redirect to another webaddress. Does anyone know how to do this? This is on Unix boxes Linux. example: https://m45.testing.address.net/host.php make it so the... (3 Replies)
Discussion started by: SkySmart
3 Replies

8. Shell Programming and Scripting

url calling and parameter passing to url in script

Hi all, I need to write a unix script in which need to call a url. Then need to pass parameters to that url. please help. Regards, gander_ss (1 Reply)
Discussion started by: gander_ss
1 Replies

9. UNIX for Advanced & Expert Users

url calling and parameter passing to url in script

Hi all, I need to write a unix script in which need to call a url. Then need to pass parameters to that url. please help. Regards, gander_ss (1 Reply)
Discussion started by: gander_ss
1 Replies

10. Shell Programming and Scripting

How to catch the output

Hi All, I have a shell script for ex- #bin/ksh sqlplus user/pass << EOF select x from y; EOF my question is can I store the value of x in a variable in unix program so that i can user that value in shell script..... additionally after catching the value i want to perform some... (4 Replies)
Discussion started by: rpraharaj
4 Replies
Login or Register to Ask a Question