크롤링 scraping 이 안되는데 왜 안되는지 아시는분 계시나요??

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
크롤링 scraping 이 안되는데 왜 안되는지 아시는분 계시나요??

QA

크롤링 scraping 이 안되는데 왜 안되는지 아시는분 계시나요??

본문

$dom = new simple_html_dom;
$dom -> load($contents);

$test = array("샤넬","프라다","구찌");
$test2 = array("황의조","황의찬","손흥민");
$test3 = array("미국","일본","한국");

//print_r($test);
//var_export($test2);
//var_dump($test3);


// get news block
    foreach($dom->find("div.txt-product",0) as $article) {
        // get title
        $item['Title'] = trim($article->find('h3', 0)->plaintext);
        
        $item['Price'] = trim($article->find('p', 0)->plaintext);

        // get details
        $item['Details'] = trim($article->find('p', 0)->plaintext);
        // get intro
        $item['ShippingPrice'] = trim($article->find('li a strong', 0)->plaintext);

        $ret[] = $item;
    }

이 질문에 댓글 쓰기 :

답변 1

foreach($dom->find("div.txt-product",0) as $article) {

위 코드에서 루프돌릴려면 find 두번째 파라메터는 빼셔야할거 같네요

foreach($dom->find("div.txt-product") as $article) {

답변을 작성하시기 전에 로그인 해주세요.
전체 136
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT