簡體   English   中英

這兩個xml請求有何不同?

[英]How are these two xml requests different?

我最近發現了一段代碼,以幫助我將實時價格納入Google表格,並希望對其進行擴展:

=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]"))

但是,當我在腳本編輯器中編寫xml請求時,我無法成功發出請求。

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

我嘗試了幾種不同的方式但是被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> 

難道我做錯了什么? 有沒有解決的辦法?

您應該利用他們的API而不是直接抓取網站,因為這是訪問定價數據的首選方式。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM