<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to support-requests</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/" rel="alternate"/><link href="https://sourceforge.net/p/simplehtmldom/support-requests/feed.atom" rel="self"/><id>https://sourceforge.net/p/simplehtmldom/support-requests/</id><updated>2025-11-06T21:02:05.187000Z</updated><subtitle>Recent changes to support-requests</subtitle><entry><title>#46 Access to array of matched elements</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/46/?limit=25#7f9f" rel="alternate"/><published>2025-11-06T21:02:05.187000Z</published><updated>2025-11-06T21:02:05.187000Z</updated><author><name/><uri>https://sourceforge.net</uri></author><id>https://sourceforge.net0f6d8c69dda21f5512fc745c7df29b82547935c7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;DELETE THIS REQUEST&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#63 Get the elements of the upper level like with CSS pseudo selector :first-child</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/63/?limit=250#afc7" rel="alternate"/><published>2024-12-02T02:50:51.753000Z</published><updated>2024-12-02T02:50:51.753000Z</updated><author><name>Hi Man O ManaO</name><uri>https://sourceforge.net/u/password/</uri></author><id>https://sourceforge.net73a75d299301176d8babb022cbfc24f65a867a56</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ok. Wrong test. The method it's called like &lt;br/&gt;
&lt;code&gt;$sections = $html-&amp;gt;find('section')-&amp;gt;firstChild();&lt;/code&gt;&lt;br/&gt;
but I got the same an error because it's an Array.&lt;br/&gt;
So there's not the same as the CSS pseudo selector rule &lt;code&gt;first-child&lt;/code&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Get the elements of the upper level like with CSS pseudo selector :first-child</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/63/" rel="alternate"/><published>2024-11-30T20:52:00.216000Z</published><updated>2024-11-30T20:52:00.216000Z</updated><author><name>Hi Man O ManaO</name><uri>https://sourceforge.net/u/password/</uri></author><id>https://sourceforge.net6ffe3b80904e6cb5a160c95ab5416730e8d12765</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm trying to scrape from some day by using CSS pseudo selector first-child.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$html&lt;span class="w"&gt; &lt;/span&gt;=&lt;span class="w"&gt; &lt;/span&gt;'
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"A"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;A&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"B"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;B&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"C"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;C
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"D"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;D&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"E"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;E&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
';

&lt;span class="w"&gt;        &lt;/span&gt;$html&lt;span class="w"&gt; &lt;/span&gt;=&lt;span class="w"&gt; &lt;/span&gt;str_get_html($html);

&lt;span class="w"&gt;        &lt;/span&gt;$sections&lt;span class="w"&gt; &lt;/span&gt;=&lt;span class="w"&gt; &lt;/span&gt;$html-&amp;gt;find('section:first-child');
&lt;span class="w"&gt;        &lt;/span&gt;foreach&lt;span class="w"&gt; &lt;/span&gt;($sections&lt;span class="w"&gt; &lt;/span&gt;as&lt;span class="w"&gt; &lt;/span&gt;$k&lt;span class="w"&gt; &lt;/span&gt;=&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;$e)&lt;span class="w"&gt; &lt;/span&gt;{
&lt;span class="w"&gt;            &lt;/span&gt;echo&lt;span class="w"&gt; &lt;/span&gt;'&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;'&lt;span class="w"&gt; &lt;/span&gt;.&lt;span class="w"&gt; &lt;/span&gt;$k&lt;span class="w"&gt; &lt;/span&gt;.&lt;span class="w"&gt; &lt;/span&gt;'&lt;span class="w"&gt; &lt;/span&gt;=&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;'&lt;span class="w"&gt; &lt;/span&gt;.&lt;span class="w"&gt; &lt;/span&gt;strip_tags($e)&lt;span class="w"&gt; &lt;/span&gt;.&lt;span class="w"&gt; &lt;/span&gt;'&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;';
&lt;span class="w"&gt;        &lt;/span&gt;}
&lt;span class="w"&gt;    &lt;/span&gt;}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;What I expect:&lt;br/&gt;
   0 =&amp;gt; AB&lt;br/&gt;
   1 =&amp;gt; C&lt;br/&gt;
   2 =&amp;gt; DE&lt;/p&gt;
&lt;p&gt;What I got? NOTHING!&lt;/p&gt;
&lt;p&gt;By looking at documentation here&lt;br/&gt;
&lt;a href="https://simplehtmldom.sourceforge.io/docs/1.9/api/simple_html_dom/firstChild/" rel="nofollow"&gt;https://simplehtmldom.sourceforge.io/docs/1.9/api/simple_html_dom/firstChild/&lt;/a&gt;&lt;br/&gt;
   you can find &lt;code&gt;firstChild()&lt;/code&gt; method so i made&lt;br/&gt;
   ~~~&lt;br/&gt;
   $sections = $html-&amp;gt;find('section').firstChild();&lt;br/&gt;
   ~~~&lt;br/&gt;
   but  I got&lt;/p&gt;
&lt;p&gt;~~~&lt;br/&gt;
   Fatal error: Uncaught Error: Call to undefined function firstChild() in XXX.php:142 Stack trace: #0 XXX.php(XX): function_name('$html') #1 {main} thrown in XXX.php on line XXX&lt;br/&gt;
   ~~~&lt;br/&gt;
   So, how to get only the upper levels?&lt;br/&gt;
   TNX. I love your PHP Simple HTML DOM Parser ❤️😘&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>PHP 8.x support</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/62/" rel="alternate"/><published>2023-02-23T16:05:05.558000Z</published><updated>2023-02-23T16:05:05.558000Z</updated><author><name>DennisKmetz</name><uri>https://sourceforge.net/u/denniskmetz/</uri></author><id>https://sourceforge.net52aad7a79ccbb139b2cf8a494c0a88451b8188c8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;My hosting provider now defaults to PHP 8.0 indicating that PHP versions PHP 7.3 and PHP 7.4 are deprecated.  It appears that the parser does not work with PHP 8.x  Although  I can still use this fantastic tool, I would like to see later versions of PHP supported.  Is that possible?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Is Github page safe to use for downloads?</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/61/" rel="alternate"/><published>2023-01-19T19:30:06.489000Z</published><updated>2023-01-19T19:30:06.489000Z</updated><author><name>hkirsman</name><uri>https://sourceforge.net/u/hkirsman/</uri></author><id>https://sourceforge.net347037311e93aa46737cab5f3b0d6fe6e8d88c04</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I was wondering if I could use &lt;a href="https://github.com/simplehtmldom/simplehtmldom" rel="nofollow"&gt;https://github.com/simplehtmldom/simplehtmldom&lt;/a&gt; for downloading specific version for my site during build? Is that maintained by you or somebody you know?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#60 No anchor text returned</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/60/?limit=25#71fb" rel="alternate"/><published>2022-08-30T21:21:44.125000Z</published><updated>2022-08-30T21:21:44.125000Z</updated><author><name>Jim Longo</name><uri>https://sourceforge.net/u/jimlongo/</uri></author><id>https://sourceforge.net3a64c44d2b40b8a072b436eb6acd1fa36d84847f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I see.&lt;br/&gt;
One would use &lt;code&gt;$e-&amp;gt;innertext&lt;/code&gt; to get the text inside the tag.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>No anchor text returned</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/60/" rel="alternate"/><published>2022-08-29T23:12:24.965000Z</published><updated>2022-08-29T23:12:24.965000Z</updated><author><name>Jim Longo</name><uri>https://sourceforge.net/u/jimlongo/</uri></author><id>https://sourceforge.net650b52ebab9c678602e0d9101ccefdb1fc762b7f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Given html like &lt;br/&gt;
&lt;code&gt;&amp;lt;a href="http://wanlesstennis.com/junior" target="_blank" rel="noopener"&amp;gt; Wanless Park Tennis Club&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I get returned &lt;br/&gt;
&lt;code&gt;[14] =&amp;gt; simplehtmldom\HtmlNode Object
        (
            [nodetype] =&amp;gt; HDOM_TYPE_ELEMENT (1)
            [tag] =&amp;gt; a
            [attributes] =&amp;gt; Array
                (
                    [href] =&amp;gt; http://wanlesstennis.com/junior
                    [target] =&amp;gt; _blank
                    [rel] =&amp;gt; noopener
                )
            [nodes] =&amp;gt; none
        )&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Doesn't the anchor text get returned as an attribute with the link?  My code is like &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$html = $doc-&amp;gt;load($url);&lt;br/&gt;
$links = [];&lt;br/&gt;
foreach($html-&amp;gt;find('a') as $e){&lt;br/&gt;
        $links[] = $e;&lt;br/&gt;
}&lt;br/&gt;
print_r($links);&lt;/p&gt;
&lt;/blockquote&gt;&lt;/div&gt;</summary></entry><entry><title>#59 Slashdot example updated</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/59/?limit=50#ba9d" rel="alternate"/><published>2022-04-09T21:55:39.863000Z</published><updated>2022-04-09T21:55:39.863000Z</updated><author><name>LogMANOriginal</name><uri>https://sourceforge.net/u/logmanoriginal/</uri></author><id>https://sourceforge.net6dc83adbc8d267af122a2619ac2252d09404c31e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;: open --&amp;gt; closed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;assigned_to&lt;/strong&gt;: LogMANOriginal&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</summary></entry><entry><title>#58 Is this project active anymore?</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/58/?limit=50#b207" rel="alternate"/><published>2022-04-09T21:49:03.931000Z</published><updated>2022-04-09T21:49:03.931000Z</updated><author><name>LogMANOriginal</name><uri>https://sourceforge.net/u/logmanoriginal/</uri></author><id>https://sourceforge.net5a020be58e5bf5a8afac56b1cf7ea9bca2cb1093</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;: open --&amp;gt; closed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;assigned_to&lt;/strong&gt;: LogMANOriginal&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</summary></entry><entry><title>#56 How to avoid break on 404 errors?</title><link href="https://sourceforge.net/p/simplehtmldom/support-requests/56/?limit=50#a3b1" rel="alternate"/><published>2022-04-09T21:35:24.098000Z</published><updated>2022-04-09T21:35:24.098000Z</updated><author><name>LogMANOriginal</name><uri>https://sourceforge.net/u/logmanoriginal/</uri></author><id>https://sourceforge.net231ba7cf90c395634e7a46fce55f47d491a9816c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;: open --&amp;gt; closed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;assigned_to&lt;/strong&gt;: LogMANOriginal&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</summary></entry></feed>