title: DOM HTML Extract with javascript
body: <p>I'm trying to extract information from an html page, specifically I'm trying to get the &quot;src&quot; url below in bold (**)</p>
  <pre><code>&lt;div class=&quot;row d-block align-end&quot; data-v-1a4e2f4c=&quot;&quot;&gt;
  &lt;div index=&quot;0&quot; class=&quot;row&quot; data-v-744a5232=&quot;&quot; data-v-1a4e2f4c=&quot;&quot;&gt;
      &lt;div class=&quot;col-lg-2 col-3&quot; data-v-744a5232=&quot;&quot;&gt;&lt;a
              href=&quot;/libro-el-peligro-de-estar-cuerda/9788432240645/12789134&quot; title=&quot;EL PELIGRO DE ESTAR CUERDA&quot;
              class=&quot;py-2&quot; data-v-744a5232=&quot;&quot;&gt;&lt;img title=&quot;el peligro de estar cuerda-9788432240645&quot;
                  alt=&quot;el peligro de estar cuerda-9788432240645&quot;
                  **src=&quot;https://imagessl5.casadellibro.com/a/l/t1/45/9788432240645.jpg&quot;**
                  data-src=&quot;https://imagessl5.casadellibro.com/a/l/t1/45/9788432240645.jpg&quot; width=&quot;&quot; height=&quot;&quot;
                  class=&quot;show-shadow cdl-img active&quot; style=&quot;max-height:undefinedpx;max-width:undefinedpx;&quot;
                  data-v-744a5232=&quot;&quot;&gt;&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  <p>The code I'm using does not seem to do the trick, although it works when extracting the title:</p>
  <pre><code>  let resultImg = xmlDoc.evaluate('./div/div/a/img[@src]', node, null, XPathResult.FIRST_ORDERED_NODE_TYPE);
      let bookImgSrc = resultImg.singleNodeValue.src;
      imgCard.src = bookImgSrc.replace('mtiny', 'large');
      divCard.appendChild(imgCard);
      console.log(imgCard);
  </code></pre>
  <p>Could someone point out what is wrong in the code and how to get the src url?</p>
  <p>I suspect the xPathResult may be wrong.</p>