Homepage von Basti1012 = ,Kurze Scripte und Codeschnipsel ,Hauptmenü

Sie sind hier : basti1012.de/ 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 } } */ ?>
 Fehler eingetragenMySQL-Error: Duplicate entry '0' for key 'PRIMARY'