Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The error message you see is just a warning:</p> <blockquote> <p>Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: ID target_editor already defined in Entity, line: 212 in /home/content/d/e/x/dext0459/html/russellsayshi/phpspellsearch.php on line 24 NULL</p> </blockquote> <p>You can ignore those, they don't stop you. If you see them on your website, you have not configured it properly, you should log errors, not display them.</p> <p>Anyway in that case for that library you can disable them this way, too:</p> <pre><code>libxml_use_internal_errors(true); </code></pre> <p>call it before loading the HTML. That HTML btw. didn't cause the error when I tried with that website.</p> <p>The next mistake is that you are looking for a class not for an ID. Look for the ID instead:</p> <pre><code>$div = $doc-&gt;getElementById('content_view'); </code></pre> <p>The whole code example:</p> <pre><code>function get_wiki_page_div($page) { $url = sprintf('http://pvpzone.wikispaces.com/%s', urlencode($page)); $doc = new DOMDocument(); $doc-&gt;validateOnParse = true; libxml_use_internal_errors(true); $doc-&gt;loadHTMLFile($url); $div = $doc-&gt;getElementById('content_view'); if (!$div) { return false; } return $doc-&gt;saveXML($div); } </code></pre> <p>Usage:</p> <pre><code>&lt;?php $submit = isset($_POST['submit']); if ($submit) { $spell = $_POST['spell']; $result = get_wiki_page_div($spell); } ?&gt; ... &lt;?php if ($submit) { echo $result ? $result : '&lt;div&gt;This is not a Spell!&lt;/div&gt;'; } ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload