htmlcssweb-scrapinginspect-element

website element is shown in browser, but hidden when i try to reach it using inspect element


This is the website https://www.justdial.com/Hyderabad/Wedding-Photographers/nct-10989300, i need to reach phone numbers given on website, but phone number is available on website but when i reach it using the inspect element method nothing is shown in inspect element. I need it to extract phone numbers using xpath.

I need to extract number using xpath, but xpath returns empty string.

//p[@class='contact-info ']/span/a

xpath should be returning phone number string but it seems its hidden by some way.


Solution

  • Because it shows like icons. See in code:

    <p class="contact-info " onclick="_ct('clntphn', 'lspg','','040PXX40.XX40.131020024501.A6E5');">
      <i class="res_contactic resultimg"></i>
      <span><a><b>
        <span class="mobilesv icon-dc"></span>
        <span class="mobilesv icon-fe"></span>
        <span class="mobilesv icon-ji"></span>
        <span class="mobilesv icon-yz"></span>
        <span class="mobilesv icon-hg"></span>
        <span class="mobilesv icon-ba"></span>
        <span class="mobilesv icon-ji"></span>
        <span class="mobilesv icon-yz"></span>
        <span class="mobilesv icon-rq"></span>
        <span class="mobilesv icon-wx"></span>
        <span class="mobilesv icon-ts"></span>
        <span class="mobilesv icon-nm"></span>
        <span class="mobilesv icon-vu"></span>
        <span class="mobilesv icon-ts"></span>
        <span class="mobilesv icon-acb"></span>
        <span class="mobilesv icon-yz"></span>
    </b></a></span>
    

    That "mobilesv icon-ts" are actuell your numbers. Just looks for .css icon library for it.