1

I found a piece of code recently to help me get live prices into Google Sheets and wanted to expand upon it:

=min(importxml("http://shop.tcgplayer.com/productcatalog/product/show?IsProductNameExact=true&ProductName="&A5, "//div[contains(@class, 'scCardContent')]/span[@*] | //div[contains(@class, 'priceGuidePricePointDiv')][1]//tr[2]/td[contains(@class, 'priceGuidePricePointData')][1]"))

However, when I wrote an xml request in the script editor I was not able to make a successful request.

  var xml = UrlFetchApp.fetch(tcgUrl).getContentText();

I tried several different ways but kept getting blocked(?) by Incapsula.

<html style="height:100%"><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><meta name="format-detection" content="telephone=no"><meta name="viewport" content="initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></head><body style="margin:0px;height:100%"><iframe src="/_Incapsula_Resource?CWUDNSAI=9&xinfo=5-85037313-0 0NNN RT(1489553959732 1) q(0 -1 -1 -1) r(0 -1) B12(4,315,0) U18&incident_id=490000360254449935-589713359258649157&edet=12&cinfo=04000000" frameborder=0 width="100%" height="100%" marginheight="0px" marginwidth="0px">Request unsuccessful. Incapsula incident ID: 490000360254449935-589713359258649157</iframe></body></html>

Am I doing something wrong? Is there a way around this?

h01001000
  • 261
  • 8
  • 20

1 Answers1

0

You should look to leverage their API instead of scraping the site directly, as that is the preferred way to access pricing data.

https://help.tcgplayer.com/hc/en-us/articles/201577976-How-can-I-get-access-to-your-card-pricing-data-

pk__
  • 231
  • 1
  • 7