cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How do I click on a link in a webpage?

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Wed, 18 Oct 2006 16:22:35 -0500

On 10/18/06, Rahul Misra <Rahul.Misra_at_sun.com> wrote:
> Hi All
> I am new to curl. Have used many tools like httpunit, htmlunit before.
> What I want to do is:
> 1. Go to a webpage

curl -o page.html http://someserver.domain.com

> 2. Search for web links on that page
> 3. Select one specific link

url=`grep "something on the page" | commands to edit out anything
that's not the url`

> 4. Click on that link

curl -o newpage.html $url

It's that middle bit that's a bugger to work out, sometimes. Luckily
there's a lot of helpful information here:

   http://curl.haxx.se/docs/httpscripting.html

Ralph Mitchell
Received on 2006-10-18