Home > Backend Development > PHP Tutorial > 哪位高手能帮小弟我解释下采集规则的意思

哪位高手能帮小弟我解释下采集规则的意思

WBOY
Release: 2016-06-13 12:00:48
Original
907 people have browsed it

谁能帮我解释下采集规则的意思

str=str.substr(str.indexOf('<table class="stripe">'),680); //请问这个680是字符的意思吗?应该怎么数呢?包括空格和代码<>""字符吗?<br />	str=str.substr(str.indexOf('<tbody>'),300);<br />	//console.log(str);<br />	var reg=/<tr>[\s\S]*?<td>(\d+)<\/td>[\s\S]*?<td>([\d\:\- ]+?)<\/td>[\s\S]*?<td class="ball">((?:[\s\S]*?<span>\d+<\/span>){3,5})[\s\S]*?<\/td>/,
Copy after login


我要采集的网站http://www.iletou.com/cqssc/kaijiang/gaopin/kjhistory_12_1.html?t=1 为什么采集不到呢?




------解决方案--------------------

本帖最后由 xuzuning 于 2014-06-19 08:48:06 编辑 n = str.indexOf('');; //取得 str 中第一次出现 
 的位置
str = str.substr(n, 680); //从开始的位置起,去 680 的字符

这是 js 代码,由于跨域的原因,是不能正常运行的
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template