火车采集器软件交流官方论坛

 找回密码
 加入会员
搜索
火车采集器V9版免费下载火车浏览器 - 可视采集,万能群发,全自动脚本工具
查看: 4294|回复: 10

请问哪位达人能采集PHPWIND7需登陆的内容?

[复制链接]
发表于 2009-1-29 12:32:36 | 显示全部楼层 |阅读模式
论坛里的视频方法不管用的。服务端似乎验证了lastpost的cookie。

在网上找了个curl登录也登录不上~~
  1. $ch = curl_init();
  2. $data   =   array(
  3. 'pwuser' =>  'lolfreeman' ,
  4. 'pwpwd' =>   'aaaaaa',
  5. 'cktime' =>   '31536000');
  6. curl_setopt($ch, CURLOPT_COOKIEJAR, "D:/web/bbs/cookies.txt");
  7. curl_setopt($ch, CURLOPT_URL,"http://www.phpwind.net/login.php?");
  8. curl_setopt($ch, CURLOPT_POST, 1);
  9. curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

  10. ob_start();         // prevent any output
  11. curl_exec ($ch); // execute the curl command
  12. ob_end_clean();     // stop preventing output
  13. curl_close ($ch);
  14. unset($ch);

  15. $ch = curl_init();
  16. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  17. curl_setopt($ch, CURLOPT_COOKIEFILE, "D:/web/bbs/cookies.txt");
  18. curl_setopt($ch, CURLOPT_URL,"http://www.phpwind.net/index.php");


  19. $buf2 = curl_exec ($ch);

  20. curl_close ($ch);
  21. echo $buf2;
复制代码
达人帮忙分析下吧,谢谢!
头像被屏蔽
发表于 2009-1-29 12:35:00 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2009-1-29 12:36:18 | 显示全部楼层
给个地址偶看看
 楼主| 发表于 2009-1-29 13:05:57 | 显示全部楼层
3# chyy

http://www.phpwind.net/thread-htm-fid-76.html

这里要求积分大于1的会员可以访问
发表于 2009-1-29 13:19:00 | 显示全部楼层
不好意思,偶没有权限
发表于 2009-1-29 13:25:40 | 显示全部楼层
测试了其他需登陆的 可以采
 楼主| 发表于 2009-1-29 13:28:15 | 显示全部楼层
5# chyy

那就这里吧
http://www.phpwind.net/search.php

用户名:lolfreeman 密码aaaaaa

反正就是要登录才能访问的页面采集不到
发表于 2009-1-29 13:48:36 | 显示全部楼层
不用试了 可以采集的 我去整个phpwind7的回复模块提高级别
 楼主| 发表于 2009-1-29 14:50:25 | 显示全部楼层
谢谢楼上的。用正常方法我还是采集不了。不过配合Curl倒是可以了。有同要问题的可以试试

附上代码:


  1. $site="http://www.xxx.com";  //要采集的站
  2. $NNDzhongyukeyile = $_GET[id];
  3. $ch = curl_init();
  4. curl_setopt($ch, CURLOPT_COOKIEJAR, "D:/web/bbs/cookies.txt"); //cookies保存文件
  5. curl_setopt($ch, CURLOPT_URL,"http://$site/login.php?"); //登录form
  6. curl_setopt($ch, CURLOPT_POST, 1);
  7. curl_setopt($ch, CURLOPT_POSTFIELDS, "forward=&jumpurl=http%3A%2F%2F$site%2F&step=2&lgt=0&pwuser=用户名&pwpwd=密码&question=0&customquest=&answer=&hideid=0&cktime=31536000"); //登录发送的数据包

  8. ob_start();         
  9. curl_exec ($ch);
  10. ob_end_clean();   
  11. curl_close ($ch);
  12. unset($ch);

  13. $ch = curl_init();
  14. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  15. curl_setopt($ch, CURLOPT_COOKIEFILE, "D:/web/bbs/cookies.txt"); //读取cookies保存文件
  16. curl_setopt($ch, CURLOPT_URL,"http://$site/xxx.php?id=$NNDzhongyukeyile");  //最终采集页面。$NNDzhongyukeyile是变量


  17. $buf2 = curl_exec ($ch);

  18. curl_close ($ch);
  19. echo $buf2;
复制代码


把以上代码保存为x.php 。放到支持curl的空间,在火车头采集http://你的域名/x.php?id=变量

就行了

评分

1

查看全部评分

发表于 2009-1-29 21:12:44 | 显示全部楼层
谢谢分享撒"!
您需要登录后才可以回帖 登录 | 加入会员

本版积分规则

企业微信|手机版|Archiver|火车采集器官方站 ( 皖ICP备06000549 )

GMT+8, 2026-4-24 20:32

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表