当前位置:首页 > 技术记录 > 正文内容

采集品牌chinaapp数据

ogfogf5年前 (2021-06-11)技术记录2033

1至3个


$pregstr = "/<div class\=\"Various\" id\=\"voteList_shida\">([\s\S]*)<div class\=\"rank_last_list\">/isU";

preg_match($pregstr,$allcontext,$ccc3);

$context13 = $ccc3[0];


$pregstr = "/<div class\=\"top_podium\">([\s\S]*)<a class\=\"check_detail\"/isU";


preg_match_all($pregstr,$context13,$list);


$data = array();


if($list[0]){

foreach($list[0] as $key => $val){

$titlestr = "/<h3>(.*?)<\/h3>/isU";

preg_match($titlestr,$val,$title);

//echo trim($title[1])."\r\n";

$contentstr = "/<span>(.*?)<\/span>/isU";

preg_match($contentstr,$val,$desc);

//echo trim($desc[1])."\r\n";

//echo "\r\n";

$data[] = array("brand"=>trim($title[1]),"branddesc"=>trim($desc[1]));

}

}





扫描二维码推送至手机访问。

版权声明:本文由技术建站文档发布,如需转载请注明出处。

分享给朋友:

相关文章

mariadb 在低配 VPS 上崩溃问题处理方案

本文章向大家介绍mariadb 在低配 VPS 上崩溃问题处理方案,主要包括mariadb 在低配 VPS 上崩溃问题处理方案使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要...

腾讯云 linux nginx 配置 ssl

首先在腾讯云购买一台服务器 (Linux),域名绑定IP,这篇文章以我的域名 banwago.com 为例。申请 DV SSL 证书,一天左右会颁发下来,假设你用的客户端是 windows,下载证书,...

PHP读取word docx文档内容及处理图片

PHP读取word文档里的文字及图片,并保存一、composer安装phpWordcomposer require phpoffice/phpword传送门:https://pac...

怎么在windows下运行shell命令

要安装官网地址: https://www.git-scm.com/用git的命令行。test.sh 用这个开头就可以#!/usr/bin/env shwindows单击右键,选择o...

linux下mysql忘记密码怎么办

前言今天在服务器安装mysql之后,登录发现密码错误,但是我没有设置密码呀,最后百度之后得知,mysql在5.7版本之后会自动创建一个初始密码。报错如下:[root@mytestlnx02 ...

安装飞桨https://www.paddlepaddle.org.cn/

是在python3.8下成功的yum install python38python3.8 -m pip install paddlepaddle==2.3.2 -i https://pypi.tuna...