title: Parse URL with DOMXPath
body: <p>i can't figure out how to get a url with DOMXPath.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;div class="row"&gt;
  &lt;div class='col-md-12'&gt;
  &lt;div class="RAElencoCanali RAEC02 elem_1 row_odd RAEC1"&gt;
  &lt;p class="RACalDate"&gt;
  &lt;span class="data"&gt;
  &lt;span class="day"&gt;06&lt;/span&gt;
  &lt;span class="mouth"&gt;mar&lt;/span&gt;
  &lt;/span&gt;&lt;/p&gt; 
      &lt;h2&gt;&lt;a title="Seminario: Confindustria Ancona" href="https://www.univpm.it/Confindustria_MarcheNord_seminario_on_line_-_marzo_2021"&gt;
      &lt;span&gt;Seminario: Confindustria Ancona&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;   
      &lt;p class="RADate"&gt;
  18 marzo 2021&lt;/p&gt;
      &lt;div class="RAFloatClear RARow1px"&gt;&amp;nbsp;&lt;/div&gt;   
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>with the php code I would like to take the link but I can't</p>
  <pre><code>$dom = new DOMDocument();
  $dom-&gt;loadHTML($html);
  
  $xpath = new DOMXPath($dom);
  $titolo1 = $dom-&gt;getElementsByTagName('h2')-&gt;Item(3); 
  $tagsTitolo = $xpath-&gt;query(&quot;*/a[@title='&quot;.$titolo1-&gt;nodeValue.&quot;']&quot;);
  </code></pre>
  <p>Thanks for your cooperation</p>