It is currently April 26th, 2024, 6:07 am

Separating different instances of <div> with the same code?

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7164
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Separating different instances of <div> with the same code?

Post by Yincognito »

You can also try to add a:

Code: Select all

UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
option to the [RocketLeague] and [ItemDImage...] measures and see if it helps, or check the Log for potential errors, if any.
Last edited by Yincognito on August 21st, 2021, 7:56 pm, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
severedmars
Posts: 17
Joined: July 17th, 2021, 6:31 pm

Re: Separating different instances of <div> with the same code?

Post by severedmars »

my about page shows that the ItemDImage measures have no value assigned to them.
Screenshot 2021-08-21 125235.png


these files are in Rainmeter-Cache, I have no idea if there are supposed to be 3 of them? now the ItemDImage3 has "rocket-league2.com" file assigned.
Screenshot 2021-08-21 125928.png


update: about 15 seconds after screenshotting the rainmeter cache folder, all 3 images and one of the weird .com duplicates are both gone.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7164
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Separating different instances of <div> with the same code?

Post by Yincognito »

severedmars wrote: August 21st, 2021, 7:56 pm my about page shows that the ItemDImage measures have no value assigned to them.

Screenshot 2021-08-21 125235.png



these files are in Rainmeter-Cache, I have no idea if there are supposed to be 3 of them? now the ItemDImage3 has "rocket-league2.com" file assigned.

Screenshot 2021-08-21 125928.png



update: about 15 seconds after screenshotting the rainmeter cache folder, all 3 images and one of the weird .com duplicates are both gone.
Hmm... I don't know. The weird .com downloads are because the [&ItemImage...] part in the ItemDImage measures' URLs is initially blank, at least until the [ItemImage...] ones retrieve their data, but although they could be initially disabled and only enabled when data is ready, they shouldn't pose a problem.

Maybe try to exit Rainmeter, wait for a minute or so, delete the TEMP files, start Rainmeter again and see if this time it works? The files are created alright, so they should be displayed, as long as the .PNG are the actual images (I don't see why they shouldn't, but you could check it out before doing the above procedure).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7164
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Separating different instances of <div> with the same code?

Post by Yincognito »

Ok, here's an idea. Try this:

Code: Select all

[Variables]
BaseURL=https://rocket-league.com
URLSite=#BaseURL#/items/shop
Item=.*<div class="rlg-item-shop__item --daily .*">.*<img class="rlg-item-shop__item-image --daily" src="(.*)".*\/>.*<h1 class="rlg-h2 rlg-item-shop__name --daily">(.*)<\/h1>

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Measures---

[RocketLeague]
Measure=WebParser
URL=#URLSite#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
RegExp=(?siU)#Item##Item##Item##Item##Item##Item#
FinishAction=[!EnableMeasureGroup ImageGroup][!UpdateMeasureGroup ImageGroup][!CommandMeasure ItemDImage1 "Update"][!CommandMeasure ItemDImage2 "Update"][!CommandMeasure ItemDImage3 "Update"][!UpdateMeter *][!Redraw]
UpdateRate=600

[ItemImage1]
Measure=WebParser
URL=[RocketLeague]
StringIndex=1

[ItemName1]
Measure=WebParser
URL=[RocketLeague]
StringIndex=2

[ItemImage2]
Measure=WebParser
URL=[RocketLeague]
StringIndex=3

[ItemName2]
Measure=WebParser
URL=[RocketLeague]
StringIndex=4

[ItemImage3]
Measure=WebParser
URL=[RocketLeague]
StringIndex=5

[ItemName3]
Measure=WebParser
URL=[RocketLeague]
StringIndex=6

[ItemDImage1]
Group=ImageGroup
Disabled=1
Measure=WebParser
URL=#BaseURL#[&ItemImage1]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
DynamicVariables=1

[ItemDImage2]
Group=ImageGroup
Disabled=1
Measure=WebParser
URL=#BaseURL#[&ItemImage2]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
DynamicVariables=1

[ItemDImage3]
Group=ImageGroup
Disabled=1
Measure=WebParser
URL=#BaseURL#[&ItemImage3]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
DynamicVariables=1

---Meters---

[MeterBackground]
Meter=Image
W=1320
H=220
SolidColor=0,0,0,64
LeftMouseUpAction=["#URLSite#"]

[MeterItemDImage1]
Meter=Image
MeasureName=ItemDImage1
X=0
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName1]
Meter=String
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName1
Text=%1
DynamicVariables=1

[MeterItemDImage2]
Meter=Image
MeasureName=ItemDImage2
X=220
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName2]
Meter=String
X=220
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName2
Text=%1
DynamicVariables=1

[MeterItemDImage3]
Meter=Image
MeasureName=ItemDImage3
X=440
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName3]
Meter=String
X=440
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName3
Text=%1
DynamicVariables=1
and see if it now works (I added updating the newly created ImageGroup measures - basically the ItemDImage measures - in the initial WebParser's FinishAction, plus the enabling of the initially disabled ItemDImage measures to avoid the creation of the .com files, just in case). If it doesn't, I'm afraid I'm out of ideas, especially since for me it works every time (I even tried deleting the Rainmeter Cache folder and loading the skin again, it recreated the 3 PNGs and used them without issues).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
severedmars
Posts: 17
Joined: July 17th, 2021, 6:31 pm

Re: Separating different instances of <div> with the same code?

Post by severedmars »

I added the extra thing that you suggested, and it didn't work. so I checked the images, and saw this:
Screenshot 2021-08-21 134841.png
does this have something to do with it?

or could it be my processing or internet speed or something? I am currently on a relatively old laptop, but I will try it on my desktop and see if there's a difference. anyways, thanks for all the help.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7164
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Separating different instances of <div> with the same code?

Post by Yincognito »

severedmars wrote: August 21st, 2021, 8:50 pm I added the extra thing that you suggested, and it didn't work. so I checked the images, and saw this:

Screenshot 2021-08-21 134841.png

does this have something to do with it?

or could it be my processing or internet speed or something? I am currently on a relatively old laptop, but I will try it on my desktop and see if there's a difference. anyways, thanks for all the help.
Could be, since they should display the image (maybe they're incomplete or 0 byte downloads):
ExplorerPNG.jpg
I just got a similar behavior as you did, but it was just WebParser having one of its very rare and temporary "freezes" (that's a known, but minor issue), and after restarting Rainmeter, it worked flawlessly as usual.

P.S. I'm on an old laptop as well, and it works. Chances are that my laptop is older than yours as well, but my internet speed is very good... :D
P.S.S. Just to cover the last (I think) possibility, make sure you're running the latest Rainmeter Beta, i.e. 4.4 Revision 3508.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
severedmars
Posts: 17
Joined: July 17th, 2021, 6:31 pm

Re: Separating different instances of <div> with the same code?

Post by severedmars »

update: i downloaded the latest rainmeter version, and tested on my desktop, and now there is nothing defined under any of the measures. is that indication of anything? also, no images are showing up in the files.
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Separating different instances of <div> with the same code?

Post by jsmorley »

severedmars wrote: August 21st, 2021, 11:24 pm update: i downloaded the latest rainmeter version, and tested on my desktop, and now there is nothing defined under any of the measures. is that indication of anything? also, no images are showing up in the files.
Try restarting Rainmeter.
User avatar
Yincognito
Rainmeter Sage
Posts: 7164
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Separating different instances of <div> with the same code?

Post by Yincognito »

severedmars wrote: August 21st, 2021, 11:24 pm update: i downloaded the latest rainmeter version, and tested on my desktop, and now there is nothing defined under any of the measures. is that indication of anything? also, no images are showing up in the files.
I suspect something else is going on here. Try this alternative, which retrieves the images in a sequential manner, i.e. download an image only after finishing downloading the previous one, as opposed to all at roughly the same time, or "concurrently":

Code: Select all

[Variables]
BaseURL=https://rocket-league.com
URLSite=#BaseURL#/items/shop
Item=.*<div class="rlg-item-shop__item --daily .*">.*<img class="rlg-item-shop__item-image --daily" src="(.*)".*\/>.*<h1 class="rlg-h2 rlg-item-shop__name --daily">(.*)<\/h1>

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Measures---

[RocketLeague]
Measure=WebParser
URL=#URLSite#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
RegExp=(?siU)#Item##Item##Item##Item##Item##Item#
FinishAction=[!UpdateMeasure ItemDImage1][!CommandMeasure ItemDImage1 "Update"]
UpdateRate=600

[ItemImage1]
Measure=WebParser
URL=[RocketLeague]
StringIndex=1

[ItemName1]
Measure=WebParser
URL=[RocketLeague]
StringIndex=2

[ItemImage2]
Measure=WebParser
URL=[RocketLeague]
StringIndex=3

[ItemName2]
Measure=WebParser
URL=[RocketLeague]
StringIndex=4

[ItemImage3]
Measure=WebParser
URL=[RocketLeague]
StringIndex=5

[ItemName3]
Measure=WebParser
URL=[RocketLeague]
StringIndex=6

[ItemDImage1]
Measure=WebParser
URL=#BaseURL#[&ItemImage1]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
FinishAction=[!UpdateMeasure ItemDImage2][!CommandMeasure ItemDImage2 "Update"]
DynamicVariables=1

[ItemDImage2]
Measure=WebParser
URL=#BaseURL#[&ItemImage2]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
FinishAction=[!UpdateMeasure ItemDImage3][!CommandMeasure ItemDImage3 "Update"]
DynamicVariables=1

[ItemDImage3]
Measure=WebParser
URL=#BaseURL#[&ItemImage3]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
FinishAction=[!UpdateMeter *][!Redraw]
DynamicVariables=1

---Meters---

[MeterBackground]
Meter=Image
W=1320
H=220
SolidColor=0,0,0,64
LeftMouseUpAction=["#URLSite#"]

[MeterItemDImage1]
Meter=Image
MeasureName=ItemDImage1
X=0
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName1]
Meter=String
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName1
Text=%1
DynamicVariables=1

[MeterItemDImage2]
Meter=Image
MeasureName=ItemDImage2
X=220
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName2]
Meter=String
X=220
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName2
Text=%1
DynamicVariables=1

[MeterItemDImage3]
Meter=Image
MeasureName=ItemDImage3
X=440
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName3]
Meter=String
X=440
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName3
Text=%1
DynamicVariables=1
Here, each following ItemDImage measure is "executed" in the FinishAction of the previous WebParser measure, with the last of them (i.e. ItemDImage3, in this case) updating the meters and redrawing the skin.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7164
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Separating different instances of <div> with the same code?

Post by Yincognito »

Yet another alternative, combining disabling and subsequently enabling the said measures with the sequential image downloading approach:

Code: Select all

[Variables]
BaseURL=https://rocket-league.com
URLSite=#BaseURL#/items/shop
Item=.*<div class="rlg-item-shop__item --daily .*">.*<img class="rlg-item-shop__item-image --daily" src="(.*)".*\/>.*<h1 class="rlg-h2 rlg-item-shop__name --daily">(.*)<\/h1>

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Measures---

[RocketLeague]
Measure=WebParser
URL=#URLSite#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
RegExp=(?siU)#Item##Item##Item##Item##Item##Item#
FinishAction=[!DisableMeasureGroup ImageGroup][!UpdateMeasureGroup ImageGroup][!EnableMeasure ItemDImage1][!CommandMeasure ItemDImage1 "Update"]
UpdateRate=600

[ItemImage1]
Measure=WebParser
URL=[RocketLeague]
StringIndex=1

[ItemName1]
Measure=WebParser
URL=[RocketLeague]
StringIndex=2

[ItemImage2]
Measure=WebParser
URL=[RocketLeague]
StringIndex=3

[ItemName2]
Measure=WebParser
URL=[RocketLeague]
StringIndex=4

[ItemImage3]
Measure=WebParser
URL=[RocketLeague]
StringIndex=5

[ItemName3]
Measure=WebParser
URL=[RocketLeague]
StringIndex=6

[ItemDImage1]
Group=ImageGroup
Disabled=1
Measure=WebParser
URL=#BaseURL#[&ItemImage1]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
FinishAction=[!EnableMeasure ItemDImage2][!CommandMeasure ItemDImage2 "Update"]
DynamicVariables=1

[ItemDImage2]
Group=ImageGroup
Disabled=1
Measure=WebParser
URL=#BaseURL#[&ItemImage2]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
FinishAction=[!EnableMeasure ItemDImage3][!CommandMeasure ItemDImage3 "Update"]
DynamicVariables=1

[ItemDImage3]
Group=ImageGroup
Disabled=1
Measure=WebParser
URL=#BaseURL#[&ItemImage3]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
FinishAction=[!UpdateMeter *][!Redraw]
DynamicVariables=1

---Meters---

[MeterBackground]
Meter=Image
W=1320
H=220
SolidColor=0,0,0,64
LeftMouseUpAction=[!CommandMeasure RocketLeague "Update"]

[MeterItemDImage1]
Meter=Image
MeasureName=ItemDImage1
X=0
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName1]
Meter=String
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName1
Text=%1
DynamicVariables=1

[MeterItemDImage2]
Meter=Image
MeasureName=ItemDImage2
X=220
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName2]
Meter=String
X=220
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName2
Text=%1
DynamicVariables=1

[MeterItemDImage3]
Meter=Image
MeasureName=ItemDImage3
X=440
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName3]
Meter=String
X=440
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName3
Text=%1
DynamicVariables=1
OR, removing / commenting out the [!CommandMeasure ItemDImage... "Update"] parts, which works as well:

Code: Select all

[Variables]
BaseURL=https://rocket-league.com
URLSite=#BaseURL#/items/shop
Item=.*<div class="rlg-item-shop__item --daily .*">.*<img class="rlg-item-shop__item-image --daily" src="(.*)".*\/>.*<h1 class="rlg-h2 rlg-item-shop__name --daily">(.*)<\/h1>

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Measures---

[RocketLeague]
Measure=WebParser
URL=#URLSite#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
RegExp=(?siU)#Item##Item##Item##Item##Item##Item#
FinishAction=[!DisableMeasureGroup ImageGroup][!UpdateMeasureGroup ImageGroup][!EnableMeasure ItemDImage1]
;[!CommandMeasure ItemDImage1 "Update"]
UpdateRate=600

[ItemImage1]
Measure=WebParser
URL=[RocketLeague]
StringIndex=1

[ItemName1]
Measure=WebParser
URL=[RocketLeague]
StringIndex=2

[ItemImage2]
Measure=WebParser
URL=[RocketLeague]
StringIndex=3

[ItemName2]
Measure=WebParser
URL=[RocketLeague]
StringIndex=4

[ItemImage3]
Measure=WebParser
URL=[RocketLeague]
StringIndex=5

[ItemName3]
Measure=WebParser
URL=[RocketLeague]
StringIndex=6

[ItemDImage1]
Group=ImageGroup
Disabled=1
Measure=WebParser
URL=#BaseURL#[&ItemImage1]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
FinishAction=[!EnableMeasure ItemDImage2]
;[!CommandMeasure ItemDImage2 "Update"]
DynamicVariables=1

[ItemDImage2]
Group=ImageGroup
Disabled=1
Measure=WebParser
URL=#BaseURL#[&ItemImage2]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
FinishAction=[!EnableMeasure ItemDImage3]
;[!CommandMeasure ItemDImage3 "Update"]
DynamicVariables=1

[ItemDImage3]
Group=ImageGroup
Disabled=1
Measure=WebParser
URL=#BaseURL#[&ItemImage3]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Download=1
FinishAction=[!UpdateMeter *][!Redraw]
DynamicVariables=1

---Meters---

[MeterBackground]
Meter=Image
W=1320
H=220
SolidColor=0,0,0,64
LeftMouseUpAction=[!CommandMeasure RocketLeague "Update"]

[MeterItemDImage1]
Meter=Image
MeasureName=ItemDImage1
X=0
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName1]
Meter=String
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName1
Text=%1
DynamicVariables=1

[MeterItemDImage2]
Meter=Image
MeasureName=ItemDImage2
X=220
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName2]
Meter=String
X=220
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName2
Text=%1
DynamicVariables=1

[MeterItemDImage3]
Meter=Image
MeasureName=ItemDImage3
X=440
Y=0
AntiAlias=1
DynamicVariables=1

[MeterItemName3]
Meter=String
X=440
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=ItemName3
Text=%1
DynamicVariables=1
Last edited by Yincognito on August 22nd, 2021, 1:57 am, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth