Unfortunately I assume you'll have to do this quite frequently. This is a great disadvantage if you're parsing a site.
It is currently January 25th, 2021, 8:01 pm
COVID-19 Statbar
-
- Rainmeter Sage
- Posts: 12110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: COVID-19 Statbar
-
- Posts: 224
- Joined: April 1st, 2015, 7:16 am
Re: COVID-19 Statbar
I don't have time to fully put this into the skin at the moment but I did play around with RainRegExp and came up with the following:
Code: Select all
RegExp=(?siU)<span class="legend-label confirmed">(.*)</span>.*<span class="legend-label critical">(.*)</span>.*<span class="legend-label deceased">(.*)</span>.*<span class="legend-label recovered">(.*)</span>.*
1: Total Cases
2: Total Critical
3: Total Deceased
4: Total Recovered
I didn't bother with "updated" - this site is constantly updated and you will notice that value always says "a few seconds ago".
I hope this helps.
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: COVID-19 Statbar
Hi balala
Yes, they (=web site designers) never care about Rainmeter Webparser parsing. And do what they want...
Yes, they (=web site designers) never care about Rainmeter Webparser parsing. And do what they want...

-
- Rainmeter Sage
- Posts: 12110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: COVID-19 Statbar
I think at least in some cases they are changing the source code of the sites exactly to avoid such tools like Rainmeter to parse their sites. I'm not sure, but have this feeling.
-
- Posts: 1029
- Joined: February 7th, 2016, 6:08 am
Re: COVID-19 Statbar
most of the sites are rebuilding to add more info and countries or rebuilding the info to show in a diffrent way... 

-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: COVID-19 Statbar
HTML structure of the nCoV2019.live seems to be changed this morning. I must modify my RegExp again (and again?)...
Now think seriously I have to be back to the worldometer...

Now think seriously I have to be back to the worldometer...
-
- Rainmeter Sage
- Posts: 12110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: COVID-19 Statbar
Yes, again and again: https://forum.rainmeter.net/viewtopic.php?p=175051#p174828
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: COVID-19 Statbar
Hi balala
Owner/developer(?) of the nCov2019.live site is a motivated highschool boy, and he always modifying the HTML to improve his COVID-19 site. Very good.
But it bothers me that my RegExp description is frequently broken. It's a dark side of the web-scraping. Maybe there would be a smart RegExp method (lookahead assertion??) to adapt to such changing HTML, but I don't know. And if such a method exists, I can't use/handle it with my skill...
I must live with it as a Rainmeter noob.
Owner/developer(?) of the nCov2019.live site is a motivated highschool boy, and he always modifying the HTML to improve his COVID-19 site. Very good.
But it bothers me that my RegExp description is frequently broken. It's a dark side of the web-scraping. Maybe there would be a smart RegExp method (lookahead assertion??) to adapt to such changing HTML, but I don't know. And if such a method exists, I can't use/handle it with my skill...
I must live with it as a Rainmeter noob.

-
- Rainmeter Sage
- Posts: 12110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: COVID-19 Statbar
Don't know, didn't take a look yet, but I doubt there is. Lookahead Assertion is used when on the site should be some occurrences of a string, but you don't know how many or if they even are there. But when the HTML code changes, usually Lookahead Assertion doesn't help.
Right now I'm not working anymore for today, but maybe tomorrow will try to figure out something. But I don't promis anything. Sorry...
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: COVID-19 Statbar
Hi balala
Thank you for clarification about the lookahead assertion.
Perhaps, I can make solution using RegExpSubstitution which follows such "changing HTML". I am not confident, but will try.
Thank you for clarification about the lookahead assertion.
Perhaps, I can make solution using RegExpSubstitution which follows such "changing HTML". I am not confident, but will try.