스누피 파싱 예제 > php

본문 바로가기
사이트 내 전체검색

php

스누피 파싱 예제

페이지 정보

작성자 서방님 댓글 0건 조회 74회 작성일 20-04-29 10:08

본문

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?
include "../lib/Snoopy.class.php";
$snoopy = new snoopy;

// 알파 전국 체인 현황
$url = "http://www.alpha.co.kr/customer/chain/chainSearchList.do?cPage=37&searchWord=&searchSmartcon=";
$snoopy->fetch($url); //긁을주소
$txt = $snoopy->results;


$tt = "|<td class=\"shop\">(.*?)</td>|";
$tt2 = "|<td class=\"subject\">(.*?)</td>|";
$tt3 = "|<td class=\"tel\">(.*?)</td>|";
$tt4 = "|<td class=\"fax\">(.*?)</td>|";

preg_match_all($tt,$txt,$content);
preg_match_all($tt2,$txt,$content2);
preg_match_all($tt3,$txt,$content3);
preg_match_all($tt4,$txt,$content4);
?>

<table>
<?
for($i=0;$i<count($content[0]);$i++) {
?>
	<tr>
		<td><?=$content[0][$i]?></td>
		<td><?=$content2[0][$i]?></td>
		<td><?=$content3[0][$i]?></td>
		<td><?=$content4[0][$i]?></td>
	</tr>
<?
}
?>
</table>

댓글목록

등록된 댓글이 없습니다.

회원로그인

접속자집계

오늘
70
어제
84
최대
1,347
전체
154,441
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.