-2
Q
외부 사이트
A
답변
2
에서 메타를 얻기 위해 어떻게 개인적으로 오히려 자바 스크립트 이상이 사용하는 PHP 가겠어요 외부 사이트 및 제목의 페이지에서 메타를 얻을하는 방법. 자바 스크립트가 정말로 필요한 경우, PHP 페이지를 AJAX 할 수 있습니다. 나는 "http://sourceforge.net/projects/simplehtmldom/" 다음이의 라인을 따라 뭔가 일이 PHP 라이브러리를 사용하여 시작합니다 :
// Create DOM from URL or file
$url = 'http://www.example.com/';
$html = file_get_html($url);
// Find all meta tags
foreach($html->find('meta') as $element){
$temp['name'] = $element->name;
$temp['content'] = $element->content;
$meta[] = $temp;
}
//Run checks on the array of meta tags or whatever you are trying to acheive
내가 쓰러 지하고 나는 이것을 확인하지 않은,하지만 난이 라이브러리의이 질문과 생각을 보았다 곧! 이
편집 테스트 한 후 도움이되기를 바랍니다 : 을 연극의 조금 후,이 코드 :
<?php
include('simple_html_dom.php');
// Create DOM from URL or file
$url = 'http://www.amazon.com/';
$html = file_get_html($url);
// Find all meta tags
foreach($html->find('meta') as $element){
$temp['name'] = $element->name;
$temp['content'] = $element->content;
$temp['charset'] = $element->charset;
$meta[] = $temp;
$temp = "";
}
print_r($meta);
?>
출력 :
Array
(
[0] => Array
(
[name] =>
[content] => on
[charset] =>
)
[1] => Array
(
[name] =>
[content] => text/html; charset=iso-8859-1
[charset] =>
)
[2] => Array
(
[name] => description
[content] => Online shopping from the earth's biggest selection of books, magazines, music, DVDs, videos, electronics, computers, software, apparel & accessories, shoes, jewelry, tools & hardware, housewares, furniture, sporting goods, beauty & personal care, broadband & dsl, gourmet food & just about anything else.
[charset] =>
)
[3] => Array
(
[name] => keywords
[content] => Amazon, Amazon.com, Books, Online Shopping, Book Store, Magazine, Subscription, Music, CDs, DVDs, Videos, Electronics, Video Games, Computers, Cell Phones, Toys, Games, Apparel, Accessories, Shoes, Jewelry, Watches, Office Products, Sports & Outdoors, Sporting Goods, Baby Products, Health, Personal Care, Beauty, Home, Garden, Bed & Bath, Furniture, Tools, Hardware, Vacuums, Outdoor Living, Automotive Parts, Pet Supplies, Broadband, DSL
[charset] =>
)
[4] => Array
(
[name] => google-site-verification
[content] => 9vpzZueNucS8hPqoGpZ5r10Nr2_sLMRG3AnDtNlucc4
[charset] =>
)
)
거의 모든 것으로 나타나는!
관련 문제
- 1. 외부 사이트
- 2. 외부 사이트
- 3. Lucene.NET 및 외부 사이트
- 4. 내 머리글이있는 외부 사이트
- 5. htdocs 외부 웹 사이트
- 6. jQuery 외부 사이트 페이지로드
- 7. 는 외부 사이트
- 8. 외부 사이트 콘텐츠로드
- 9. Django 사이트 외부 액세스
- 10. 폰갭 - 외부 웹 사이트
- 11. 웹 사이트 외부 메뉴
- 12. 외부 사이트 인증
- 13. 외부 사이트 복사 (말림) 사이트, 리디렉션하는 방법
- 14. 외부 사이트 필드 입력 자동화
- 15. webview에서 외부 웹 사이트 열기
- 16. 검사 외부 웹 사이트 등록은
- 17. drupal 검색 가난한가요 - 외부 사이트
- 18. 는 외부 호스팅 웹 사이트
- 19. 외부 웹 사이트 등록 확인
- 20. trigger.io - 삽입 외부 웹 사이트
- 21. 웹 사이트 내 외부 페이지로드
- 22. 사이트 맵 0.9 - 외부 링크
- 23. 트랙은 이미지의 외부 웹 사이트 /의 트래픽은 외부 웹 사이트에로드되는
- 24. jsonp를 사용하여 외부 사이트 webmethod를 호출 하시겠습니까?
- 25. Block Drupal에 외부 웹 사이트 기사 표시
- 26. Schema.org - JSON-LD 외부 사이트 용?
- 27. 웹 사이트 외부 링크 : HTTP 대 HTTPS?
- 28. 외부 웹 사이트 iframe의 양식 채우기
- 29. MVC5 '링크 로그인'현재 아이덴티티를 잃고 외부 사이트
- 30. 프레임이 외부 프레임에 액세스하는 iframe 사이트