Sie sind hier : sebastian1012.bplaced.net/ homepage-neu / Kurze-Scripte-und-Codeschnipsel / index.php

Zurück


Der Quellcode dazu


loadHTMLFile($file);
 
$tag_name = 'a';
$elements = $doc->getElementsByTagName($tag_name);
echo "
";
if (!is_null($elements)) {
   foreach ($elements as $element) {
     echo "
". $element->nodeName. ": "; $nodes = $element->childNodes; foreach ($nodes as $node) { echo $node->nodeValue; } } } */ ?> loadHTML($content); $path = new DOMXPath($document); $urls = $path->evaluate("/html/body//a"); for ($x = 0; $x < $urls->length; $x++) { $hrefs[$x] = $urls->item($x)->getAttribute('href'); } return $hrefs; } @$link=getUrls('https://sebastian1012.bplaced.net/homepage-neu/'); echo "
";
 print_r($link);
 echo  "
";
 
 
 /*
@$doc = new DOMDocument();
@$doc->loadHTMLFile($link[33]);
 
@$tag_name = 'main';
@$tag2='article';
@$tag3='div';
 $elements = $doc->getElementById($tag_name);
 
 $elements = $doc->getElementsByTagName($tag2)[0];
 $brennen=$elements->ownerDocument->saveHTML($elements);
 
 
// $html = file_get_contents($link[33]);
// foreach($html->find('h1') as $element){
//       echo $element->innertext . '
'; // } //echo $brennen; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML($brennen); libxml_clear_errors(); $h1List = $dom->getElementsByTagName('h1'); $article = $dom->getElementsByTagName('article'); if($h1List->length == 0){ }else{ foreach($h1List as $h1){ print_r($h1->nodeValue);// h1 auslesen } } */ ?>

Add Comment

* Required information
1000
Powered by Commentics

Comments (1)

Gravatar
Admin
Sascha65says...

Die Canvas Balken Uhr ist ja mal Fett