Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1579

Help: Rainmeter Skins • Re: Web Parser on Amazon

$
0
0
I linked to their "API Gateway" page in my earlier reply, though I referred mostly to a HTTP API (also linked on that page). Unfortunately, their setup process looks complicated, with AWS, blah blah blah and whatnot, but apparently they provide a free tier, I suppose with signing in to an Amazon account the main / first requirement. I don't know for sure, cause I never tried it.

Generally speaking (Amazon's complicated system aside), I was talking about a Web API. In simple terms, the main differences from a typical web address for the user (i.e. you when requesting data) is that the API one has api. somewhere at the beginning of the address, it returns a JSON or similar and not a HTML, and you can use various parameters in the query string to get data on multiple things and not just a single one (like weather for 15 days in the case of weather.com skins, for example). One of the particularities of a Web API is that it typically uses an API Key or Token as one of the parameters in the query string, which is meant to identify the one requesting data access, and which might be free or not.

Regarding headers, you could try replicating those Python ones in Rainmeter and see if that works better. WebParser has the HeaderN options and the syntax of their values is similar to the Python parts (bar the apostrophes / single quotes), see the example and the link in the manual (additional details here).
Thank you for the extra info. I had time to test today with no luck yet. I haven't been able to parse it today.

I have tried with multiple headers (I'm testing with only one product):

Code:

[Product1]Group=ProductsMeasure=WebParserURL=[#Product1Link]UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36RegExp=(?siU)id="twister-plus-price-data-price" value="(.*)".*class="a-size-medium a-price-symbol">(.*)</span>.*class="a-unordered-list a-nostyle a-horizontal list maintain-height">.*src="(.*)".*id="productTitle" class="a-size-large product-title-word-break">\s*(\S.*)</span>FinishAction=[!EnableMeasureGroup Product1][!EnableMeasure Product2][!Update]Header=Accept-Language: en,es;q=0.9,es-ES;q=0.8Header2=Accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8Header3=Accept-Encoding: gzip, deflate, br, zstdHeader4=Referer: https://www.google.com/Debug=2DynamicVariables=1
Nothing seems to help unfortunately. I have also tried with different user agents and referers.

Statistics: Posted by RicardoTM — Yesterday, 8:48 pm



Viewing all articles
Browse latest Browse all 1579

Trending Articles