It is currently November 21st, 2019, 10:17 am

Extract all data from a webpage where rows of data vary from day to day.

Help with creating, editing & fixing problems with skins
BalenoMan
Posts: 1
Joined: November 5th, 2019, 9:42 pm

Extract all data from a webpage where rows of data vary from day to day.

BalenoMan » November 5th, 2019, 10:24 pm

I use NextPVR to record TV shows on my pc. I use the following webparser regex to extract future tv recordings data from NextPVRs local webserver:

RegExp="(?siU)(?(?=.*<div class).*"listing.*">(.*)<.div>)(?(?=.*<div class).*"airDate">(.*)<.div>)(?(?=.*<div class).*"airTime">(.*)<.div>)(?(?=.*<div class).*"channelNum">(.*)<.div>)(?(?=<div class).*"channelName">(.*)<.div>).*(?(?=.*onclick).*return false;">(.*)<.a>)"

The above code extracts 1 TV recording. If I want to view more than one recording then I make a copy of the code above and paste it multiple times corresponding to the number of recordings I want to see. The problem is that if the webserver contains 20 future recordings and I am trying to webparse 21 then my rainmeter skin doesn't work because I have tried to webparse beyond the data that is on the webserver. Given that the data is TV show recordings then it can vary from day to day.

Currently my skin shows the next 8 TV recordings. If I want to extract ALL future TV recordings data from the webserver, how would I do that given that the amount of data can vary from day to day? Is there a magical webparser regex expression that can run on varying amounts of data from a webserver? Or is there a Rainmeter function that can count the amount of data in the webserver and then run a webparser on the number counted?
User avatar
balala
Rainmeter Sage
Posts: 9107
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Extract all data from a webpage where rows of data vary from day to day.

balala » November 6th, 2019, 4:42 pm

BalenoMan wrote:
November 5th, 2019, 10:24 pm
If I want to extract ALL future TV recordings data from the webserver, how would I do that given that the amount of data can vary from day to day? Is there a magical webparser regex expression that can run on varying amounts of data from a webserver? Or is there a Rainmeter function that can count the amount of data in the webserver and then run a webparser on the number counted?
Yes, actually there is a such feature. It's called Lookahead Assertion.
But it is used in the posted RegExp, so I'm not sure: do you know about this or not? Because those (?(?= in the RegExp proves you've used it. Doesn't properly work? It should, but I'm not sure if it really does, especially that we don't know your code.
So, first you have to post the code of your skin, not just the code of the RegExp option. At least post the code of the parent WebParser measure, which has the posted RegExp.