Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LYNX web request help 1

Status
Not open for further replies.

Pholden

Programmer
Oct 29, 2010
3
0
0
US
Hello. I am new to unix shell scripting and am having some trouble with a program. I am using a lynx web request to dump information from a website. I am trying to display only certain lines containing information I want displayed so I am using | grep "xxx".

I will only display the problem code and if you need the rest to help me with my problem I will gladly post it.
Code:
lynx [URL unfurl="true"]http://innopac.xxx.org:4500/PATRONAPI/$barcode[/URL] | grep -o "EXP.DATE..*"
			   lynx [URL unfurl="true"]http://innopac.xxx.org:4500/PATRONAPI/$barcode[/URL] | grep -o "P.TYPE..*"
			   lynx [URL unfurl="true"]http://innopac.xxx.org:4500/PATRONAPI/$barcode[/URL] | grep -o "PATRN.NAME..*"
			   lynx [URL unfurl="true"]http://innopac.xxx.org:4500/PATRONAPI/$barcode[/URL] | grep -o "TELEPHONE2..*"
			   lynx [URL unfurl="true"]http://innopac.xxx.org:4500/PATRONAPI/$barcode[/URL] | grep -o "EMAIL.ADDR..*"
I am able to retrieve the first lynx web request and display "EXP.DATE..*" but then the terminal seems to freeze and the only thing I can do is quit the whole program using CTRL + Z. I greatly appreciate any help and/or advice. Thank-you in advance.
 
What about this ?
Code:
lynx -dump [URL unfurl="true"]http://innopac.xxx.org:4500/PATRONAPI/$barcode[/URL] |
 grep -Eo "EXP.DATE..*|P.TYPE..*|PATRN.NAME..*|TELEPHONE2..*|EMAIL.ADDR..*"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Wow. Quick response. Works flawlessly. Thank you so much PHV!
 
Hmm.. Thats odd. Doesn't seem to work for some barcodes, and some it does. For the lynx webrequest you have to hit the down arrow key to go to next page. The latter of the search terms is on the second page for some of the barcodes. Is there a way to simulate pressing down arrow key, or is there some other way to display from the next page? Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top