wget and &


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers wget and &
# 1  
Old 02-23-2012
wget and &

Hi,
I'm trying to I'm trying to use wget to grab some data from the IRIS webservice. Basically its a web page that given the latitude and longitude for two points on the earth returns the distance and azimuth between them.
Its usage is simple you just input an address as follows,
http://www.iris.edu/ws/distaz/query?stalat=0.0&stalon=0.0&evtlat=15.0&evtlon=0.0
and it opens a page containing the data in XML.
I have tried,
Code:
wget http://www.iris.edu/ws/distaz/query?stalat=0.0&stalon=0.0&evtlat=15.0&evtlon=15.0

but get a bad request error which I think comes from the use of the ampersands in the address. Anyone know how I could do this??
Thanks
D

---------- Post updated at 02:15 PM ---------- Previous update was at 01:39 PM ----------

ok I got it, I just forgot the quotes Smilie
but if someone could tell me how to save as a text file I'd appreciate it.
# 2  
Old 02-23-2012
What error are you seeing?

I don't get any error when I do this:
Code:
wget -O output.html "http://www.iris.edu/ws/distaz/query?stalat=0.0&stalon=0.0&evtlat=15.0&evtlon=15.0"

Whatever you're looking for will be in "output.html"
# 3  
Old 02-23-2012
Quote:
Originally Posted by balajesuri
What error are you seeing?

I don't get any error when I do this:
Code:
wget -O output.html "http://www.iris.edu/ws/distaz/query?stalat=0.0&stalon=0.0&evtlat=15.0&evtlon=15.0"

Whatever you're looking for will be in "output.html"
Or if you need it in xml format:

Code:
wget -O output.xml "http://www.iris.edu/ws/distaz/query?stalat=0.0&stalon=0.0&evtlat=15.0&evtlon=15.0"

# 4  
Old 02-23-2012
Quote:
Originally Posted by spynappels
Or if you need it in xml format:
Changing the extension of a filename does not change its format. This just names it XML, whether it deserves that extension or not.
# 5  
Old 02-23-2012
Quote:
Originally Posted by Corona688
Changing the extension of a filename does not change its format. This just names it XML, whether it deserves that extension or not.
The OP said the data was in XML format, so naming the outfile *.xml means it can be used by other packages expecting an XML file.
# 6  
Old 02-23-2012
thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies

2. Shell Programming and Scripting

Wget - working in browser but cannot download from wget

Hi, I need to download a zip file from my the below US govt link. https://www.sam.gov/SAMPortal/extractfiledownload?role=WW&version=SAM&filename=SAM_PUBLIC_MONTHLY_20160207.ZIP I only have wget utility installed on the server. When I use the below command, I am getting error 403... (2 Replies)
Discussion started by: Prasannag87
2 Replies

3. Shell Programming and Scripting

Sort a the file & refine data column & row format

cat file1.txt field1 "user1": field2:"data-cde" field3:"data-pqr" field4:"data-mno" field1 "user1": field2:"data-dcb" field3:"data-mxz" field4:"data-zul" field1 "user2": field2:"data-cqz" field3:"data-xoq" field4:"data-pos" Now i need to have the date like below. i have just... (7 Replies)
Discussion started by: ckaramsetty
7 Replies

4. Shell Programming and Scripting

Replace & sign to &amp word

Hi, I have text file abc.txt. In this file, I have the following data. Input: Mr Smith &amp Mrs Smith Mr Smith &apos Mrs Smith Mr Smith & Mrs Smith Mr Smith& Mrs Smith Mr Smith &Mrs Smith Output: Mr Smith &amp Mrs Smith Mr Smith &apos Mrs Smith Mr Smith &amp Mrs Smith Mr Smith&amp... (4 Replies)
Discussion started by: naveed
4 Replies

5. Shell Programming and Scripting

replace & with & xml file

Hello All I have a xml file with many sets of records like this <mytag>mydata</mytag> <tag2>data&</tag2> also same file can be like this <mytag>mydata</mytag> <tag2>data&</tag2> <tag3>data2&amp;data3</tag3> Now i can grep & and replace with &amp; for whole file but it will replace all... (4 Replies)
Discussion started by: lokaish23
4 Replies

6. Shell Programming and Scripting

Help needed in Curl & Wget

We are trying to invoke a https service from our unix script using curl command. The service is not getting invoked because it is SSL configured. Bypassing certification (using curl –k) does not work. curl -k https://site curl -k -x IP:Port https://site curl -k -x IP:443 https://id:pwd@site ... (0 Replies)
Discussion started by: dineshbabu01
0 Replies

7. Shell Programming and Scripting

PHP read large string & split in multidimensional arrays & assign fieldnames & write into MYSQL

Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP. I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Discussion started by: lowmaster
0 Replies

8. UNIX for Dummies Questions & Answers

Problem with xterm & tcsh & sourcing a script in a single command

Hi friends, I have a script that sets the env variable path based on different conditions. Now the new path variable setting should not done in the same terminal or same shell. Only a new terminal or new shell should have the new path env variable set. I am able to do this only as follows: >cd... (1 Reply)
Discussion started by: sowmya005
1 Replies

9. UNIX for Dummies Questions & Answers

Search for & edit rows & columns in data file and pipe

Dear unix gurus, I have a data file with header information about a subject and also 3 columns of n rows of data on various items he owns. The data file looks something like this: adam peter blah blah blah blah blah blah car 01 30 200 02 31 400 03 57 121 .. .. .. .. .. .. n y... (8 Replies)
Discussion started by: tintin72
8 Replies

10. Shell Programming and Scripting

wget & rapidshare

Hello people, I have a question concerning wget and rapidshare. How I can download from Rapidshare (have a premium account) using command-like tool wget. It seems pretty easy, but I always get only very small file (5KB) something like html. Please correct me if I am doing something in a wrong... (1 Reply)
Discussion started by: trolis
1 Replies
Login or Register to Ask a Question