+ -
当前位置:首页 → 问答吧 → 网页内容抓取问题

网页内容抓取问题

时间:2011-06-21

来源:互联网

我要在一个网页的download下载内容.如果是window上的话,大家知道,先用户登录,然后直接点击download ,然后弹出下载框,我们保存到相应位置即可.

那在linux下呢?要怎么做?
我请教了下身边的人,是这样做的:
先生成cookie:
curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -d "login_username=loginname&login_password=mypassword&action=login&submit=Login" URL -D cookie.txt

然后利用cookie登录并输出下载文件到/file/path:
curl "DownURL" -b cookie.txt  -o /file/path

但是不能下载到内容,不知道怎么回事,有没有知道的,帮忙看下....

作者: zhnghaijin   发布时间: 2011-06-21

作者: zhnghaijin   发布时间: 2011-06-21

帮你顶!求高手路过

作者: lionfun   发布时间: 2011-06-21

回复 zhnghaijin


wget --user=user --password=password http://.....
       --user=user
       --password=password
           Specify the username user and password password for both FTP and HTTP
           file retrieval.  These parameters can be overridden using the
           --ftp-user and --ftp-password options for FTP connections and the
           --http-user and --http-password options for HTTP connections.

作者: 南极雨   发布时间: 2011-06-21

等高手解答吧:dizzy:

作者: dgmlf120   发布时间: 2011-06-21