Can't get the data using importXML from Dynamic Web Page?

后端 未结 1 828
栀梦
栀梦 2020-12-10 23:10

The website is : https://www.futbin.com/18/player/2600/Ayhan/

I inspect the element and get the XPath which is: //*[@id=\"ps-lowest-1\"]

Then I

相关标签:
1条回答
  • 2020-12-10 23:39

    The Sheets command importXML reads only the HTML source of the page without executing any JavaScript on it. As you can see yourself by using "view source" in the browser, the source indeed has "-" in that span:

     <span class="price_big_right">
         <span id="ps-lowest-1">-</span>
     </span>
    

    The actual numbers are loaded by some JavaScript file which then inserts them in that span. Neither importXML nor other Sheets functions can retrieve dynamically inserted data.

    Sometimes, after inspecting the JS files, one can uncover the URL of source of data and try to import that; but this is a tedious reverse engineering exercise for each particular site.

    0 讨论(0)
提交回复
热议问题