파싱 질문합니다

파싱 질문합니다

QA

파싱 질문합니다

본문

    /**
     * 게시판 본문 내용을 크롤링후  파싱한다.
     * 파싱대상은 제목, 본문내용, 첨부파일, 등록자명, 등록자 아이디, 등록일자 등
     *
     * $uri
     * array
     */
    public function getContent($wr_id, $url) {
        $result = array();

        $crawler = $this->client->request('GET', $url);
        $result['wr_id'] = $wr_id;
        $result['wr_subject'] = $crawler->filter("h2.head_h2")->text();
        $result['wr_name'] = $crawler->filter("#info_name span.sv_wrap a .member")->text();
        $writer_link =  $crawler->filter("#info_name span.sv_wrap a")->attr("href");
        $parts = parse_url($writer_link);
        parse_str($parts['query'], $query);
        $result['mb_id'] = $send_mb_id = $query['mb_id'];
        $result['wr_datetime'] =  $crawler->filter("#info_date")->text();
        $result['wr_hit'] =  $crawler->filter("#info_hit span")->text();
        $result['wr_comment_cnt'] =  $crawler->filter("#info_cmt a span")->text();

        $result['wr_content'] =  $crawler->filter("#vbo_con .con_inner")->html();

        $result['content_images'] = $this->getContentImages($crawler->filter("#vbo_con .con_inner"));

        $result['comments'] = $this->getCommentList($crawler->filter("section.vbo_vcmt"));

        return $result;

    }

 

 

위와같은 코드에서 만약 내용에 링크가 들어가면 예시로 naver로 갈 수 있게 하고 싶습니다.

어떻게 하면 될까요?ㅠㅠ

이 질문에 댓글 쓰기 :

답변 1

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

회원로그인

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