Mod collection details
For unclear reasons, the underlying calls will produce a lot of JSON. It's around ~1.4 MB(!) zipped across the wire (and ~7MB unzipped).
This is why the UI is sluggish on initial load.
The backend call is a POST to https://www.gibson.com/en-US/Collection/GetProductGridList.
curl 'https://www.gibson.com/en-US/Collection/GetProductGridList' --compressed -X POST -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Referer: https://www.gibson.com/en-US/Collection/gibson-mod?filter=iso' -H 'Content-Type: application/json' -H 'Origin: https://www.gibson.com' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Priority: u=4' -H 'TE: trailers' --data-raw '{"ComponentIds":["4Bmy2OdwhOY372zwmjPn16"],"InStockOnly":true}'
The useful headers are:
POST /en-US/Collection/GetProductGridList HTTP/2
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Referer: https://www.gibson.com/en-US/Collection/gibson-mod?filter=iso
Content-Type: application/json
https://www.gibson.com/en-US/Collection/gibson-custom-select
CURL
curl 'https://www.gibson.com/en-US/Collection/GetProductGridList' --compressed -X POST -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Referer: https://www.gibson.com/en-US/Collection/gibson-custom-select' -H 'Content-Type: application/json' -H 'Origin: https://www.gibson.com' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Priority: u=4' -H 'TE: trailers' --data-raw '{"ComponentIds":["5RjxBwISl2NnlLZ34cVHou"],"InStockOnly":false}'
Headers for Select
POST /en-US/Collection/GetProductGridList HTTP/2
Host: www.gibson.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Referer: https://www.gibson.com/en-US/Collection/gibson-custom-select
Content-Type: application/json
Content-Length: 63
Origin: https://www.gibson.com
DNT: 1
Sec-GPC: 1
Connection: keep-alive
Priority: u=4
TE: trailers
def g(jx):
p0 = jx['ProductGridList'][0]
for p1 in p0['Products']:
slug = p1['Slug'] # This is used to construct the details URL
desc = p1['MarketingCopy']['LongFormHTML']
skus = p1['Skus']
for sku in skus:
yield (slug, ) + f(sku) + (desc,)
def f(sx):
# For each Sku
return (sx["SeoId"], sx["SeoName"], sx['Sys']['CreatedAt'], sx['DefaultDirectPrices']['USD'],
"https:" + sx['DefaultImage']['File']['Url'])