Browse code

예제 수정

Ikseon Kang authored on17/06/2019 06:52:00
Showing1 changed files
... ...
@@ -9,7 +9,7 @@ $url = "https://hiseon.me";
9 9
 $html = file_get_html($url);
10 10
 
11 11
 foreach($html->find('a') as $a) {
12
-  echo $a->href. "\n";
12
+  echo $a-> innertext . " :: ". $a->href. "\n";
13 13
 }
14 14
 
15 15
 ?>
Browse code

주석, url 수정

Kang IkSeon authored on18/03/2018 13:37:34
Showing1 changed files
... ...
@@ -3,8 +3,9 @@
3 3
 // http://simplehtmldom.sourceforge.net/
4 4
 include "lib/simple_html_dom.php";
5 5
 
6
-$url = "http://media.daum.net/cp/11?page=1&regDate=20171111";
6
+$url = "https://hiseon.me";
7 7
 
8
+// HTML 객체 생성
8 9
 $html = file_get_html($url);
9 10
 
10 11
 foreach($html->find('a') as $a) {
Browse code

메인 실행파일 추가

Kang, Ikseon authored on18/03/2018 12:32:52
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+// http://simplehtmldom.sourceforge.net/
4
+include "lib/simple_html_dom.php";
5
+
6
+$url = "http://media.daum.net/cp/11?page=1&regDate=20171111";
7
+
8
+$html = file_get_html($url);
9
+
10
+foreach($html->find('a') as $a) {
11
+  echo $a->href. "\n";
12
+}
13
+
14
+?>