Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML parser in Javascript
    primarykey
    data
    text
    <p>Hi i at the momment try to parse some HTML news for our new fan page. Caus the company do not offer a RSS Feed.</p> <p>I got a new JS File with that included</p> <pre><code>function getNews() { y = 0; news = new Array(7); news_content = new Array(5); for (var i = 0; i &lt; news.length; i++) { var table = document.getElementById('news').contentWindow.getElementsByTagName('table')[y]; news_content[0] = table.rows[0].cells[0].getElementsByTagName('img')[0].src; news_content[1] = table.rows[0].cells[1].getElementsByTagName('span')[0].innerHTML; news_content[2] = table.rows[0].cells[2].getElementsByTagName('span')[0].innerHTML; news_content[3] = table.rows[1].cells[0].getElementsByTagName('p')[0].innerHTML; news_content[4] = table.rows[0].cells[0].getElementsByTagName('a')[0].href; //alert(news[0] + "\n" + news[1] + "\n" + news[2] + "\n" + news[3] + "\n" + news[4]); news[i] = news_content[0] + "\n" + news_content[1] + "\n" + news_content[2] + "\n" + news_content[3] + "\n" + news_content[4] + "\n"; y = y + 2; } alert (news[0] + "\n" + news[1] + "\n" + news[2] + "\n" + news[3] + "\n" + news[4]) } </code></pre> <p>and that html </p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Unbenanntes Dokument&lt;/title&gt; &lt;script src="test.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;a href="page.html" onclick="getNews()"&gt;Hier klicken&lt;/a&gt; &lt;iframe id="news" src="http://www.aerosoft-shop.com/list_news.php?cat=fs&amp;lang=de"&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>At last if i pase the source code into the html file it works but is there no way to parse from a external page?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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