Google-sheets – Unable to import pricing info from toysrus.com into a Google Spreadsheet

google sheetsgoogle-apps-scriptimportxmlxpath

I'm trying to pull live pricing from a given toysrus.com item into a Google Spreadsheet (one item/price per row), and am having no luck whatsoever. Importxml(url, xpath) does not work (similar to the problem encountered with someone scraping from walmart.com here: Import current price from website to spreadsheet). I am not familiar with JavaScript, but I'm wondering if a custom script is my best way forward, or using Curl or some other external script?

I'm pulling the data into a spreadsheet for a given product comparing in stock/out of stock status, and the pricing/stocking status from other retailers. I was able to pull in the pricing data from Target.com rather easily using importxml, but it does not work with Toys R Us. As an example, I'd want to pull in the pricing data from http://www.toysrus.com/product/index.jsp?productId=22360626. I can see from inspecting the coding that the pricing appears at

<li class="retail fl "> <span>$39.98</span>

Every method I've tried returns either an error or blank value. I think the extensive use of javascript on the page may be complicating things.

Best Answer

This formula worked perfectly for me:

=IMPORTXML("http://www.toysrus.com/product/index.jsp?productId=22360626","//*[@id='price']/ul/li[2]/span")
Related Topic