您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP采集网页信息

2025/9/10 7:01:05发布20次查看
【求助】php采集网页信息
需要采集 
http://bbs.zhanzhang.baidu.com/home.php?mod=space&uid=*
不同uid的用户名
不熟悉php以及正则,只是单纯的想要结果,所以麻烦直接给出php代码和前1000个uid的用户名,谢谢。
php
------解决方案--------------------
$html = file_get_contents('http://bbs.zhanzhang.baidu.com/home.php?mod=space&uid=1');
preg_match('@(.*?)@',$html,$match);
//var_dump($match);
echo strip_tags($match[0]);
理论上uid是自增的,前1000个就是1-1000,数字自己换吧。
------解决方案--------------------
$url = 'http://bbs.zhanzhang.baidu.com/home.php?mod=space&uid=';
$res = array();
$uid = 1;
while(count($res)  sitemapbbs
    [7] => _
    [8] => sitemaptest2
    [9] => sitemaptest
    [10] => sitemaptest32
    [13] => sitemaptest3
    [14] => kkksuper
    [16] => 05
    [17] => caoli456
    [18] => wangbin_ivan
    [19] => geiwosou
    [20] => sitemap_test1
    [21] => sitemap_test5
    [22] => _
    [23] => lkmmmmj
    [24] => blackfox1983
    [25] => dongbei_wb
    [26] => xyzlinger
    [27] => sanwushuosi
    [28] => 007
)
------解决方案--------------------
同上,不过file_get_contents方法有时候会太慢,可以采用curl.
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product