0

Edit: So I've found a solution. Using the third-party Cheerio script, I was able to scrape bits and pieces of the web-page (including the price) and I made a custom formula in AppsScript that parses through the returned values, looks for a dollar sign then extracts the value. It tends to run quickly, although I'm not sure on the frequency of updates as of yet.


I'm trying to pull a price from a website into a Google Sheet and have it update every X hours or X days or so. Here's my current formula with a working URL and example:

=ARRAY_CONSTRAIN(importxml(lower("https://www.pricecharting.com/game/pokemon-unbroken-bonds/reshiram-&-charizard-20"), "//td[1]"),1,1)

Problem being, it appears Google restricts this as it will show as "Loading..." in several of my sheets if I copy and paste it down my entire sheet (referencing several different URLs, not just the one above). I believe it may be a part of their 50 importxml limit.

I've tested the importRegex function that someone built here: To exceed the ImportXML limit on Google Spreadsheet which works for <title></title> but I can't seem to get it to pickup the price found down the page inside of <span class="price js-price"></span>

Can anyone assist with this?

vahnx
  • 3
  • 2
  • My suggestion is that you use [UrlFetchApp](https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#fetch(String,Object)) instead. In my experience, IMPORTXML and IMPORTHTML functions are quite limited for specific requirements. – Marco Aurelio Fernandez Reyes Sep 01 '22 at 22:52
  • @MarcoAurelioFernandezReyes So I've looked at that a bit and am struggling implementing it. Inside of [this Google Sheet](https://docs.google.com/spreadsheets/d/1SusLxBZK8bbV7fn-n-VU0QybMt4ms15lp6msjhuV7Vw/edit?usp=sharing), in the Price Grab Scraping script, I'm running the 'extractPriceTest' function and the first value is coming back fine, but when I try going further down the HTML on the page to extract the portion of the page I need (the Ungraded price) I just can't seem to get it to work. – vahnx Sep 02 '22 at 14:50

0 Answers0