I don't see any reason why you can't parse that site.
There are two considerations that I found I had to take into account:
1) The site is checking to see if you are using a web "browser", in order to stop you from doing exactly what you are trying to do, to hit the site with an application on some regular basis. I assume the authors would prefer not to be hammered by some external, non-human process. Since you are presumably going to only be hitting the site every 10 minutes (the default for WebParser), I think it would be ok.
You do that by using the UserAgent option in your parent WebParser measure:
https://docs.rainmeter.net/manual/measures/webparser/#UserAgent
https://www.whatismybrowser.com/detect/what-is-my-user-agent
I used:
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
And it worked fine. Without that, I get a 403-Forbidden error from the site.
Checking the user agent string is a pretty basic "locks are to keep honest people honest" way of detecting that you are coming from a "browser", and there is no certainty that they won't find that they are getting more traffic than they want and take more robust steps. I would strongly recommend that you don't hit the site more often than every 10 minutes or so. Doing so may only be shooting yourself in the foot.
2) If you are using the text [description] and the like to zero in on the information you want, (and I would) remember that
[ and
] are both "reserved characters" in regular expression, and must be
\escaped to be used as a literal in your search.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureSite]
Measure=WebParser
URL=https://isitraining.in/chicago
RegExp=(?siU)\[description\] => (.*)\n.*\[temperature\] => (.*)\n
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
[MeasureDescription]
Measure=WebParser
URL=[MeasureSite]
StringIndex=1
[MeasureTemperature]
Measure=WebParser
URL=[MeasureSite]
StringIndex=2
[MeterDescription]
Meter=String
MeasureName=MeasureDescription
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
[MeterTemperature]
Meter=String
MeasureName=MeasureTemperature
Y=5R
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
1.png
So the pattern is relatively simple. Just use
.*\[Whatever\] => (.*)\n repeatedly to find the element you want, detecting the end of the text with a
\n linefeed, then on to the next one. Should be fairly easy to get any or all of those [ElementName] deals from the top of the site.
You do not have the required permissions to view the files attached to this post.