Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Linx / Lynx CLI output?


    Hi, Everybody,

    Does anyone know if it is possible to use a console-based web browser (i.e. links or lynx) to render a page in the terminal, but then terminate immediately? I basically want to pipe the output of a webpage to grep. I was thinking this also might be possible with curl or wget...As I said, I'm trying do the equivalent of cating a text file and piping it to grep, but with an HTML page.

    Any insight would be appreciated.

    Thanks,

    Dan

  2. #2
    Tell wget to write to STDOUT (standard output, or more simply, the terminal screen) instead of writing to file, which is the default. use the -O (capital oh, not zero), followed by a dash (hyphen), e.g.:

    Code:
    wget -O - http://www.example.com
    Edit: forgot about lynx, i used to actually use this a lot in scripts:

    Code:
    lynx -dump http://www.example.com
    Last edited by atreyu; 01-15-2012 at 05:22 AM. Reason: lynx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •