Yes it is what I was asking, but I'm still not sure what it is about those div tags that is changing. In any case...
This site is a good example of a basic principle. While I love RoboBrowser for the things that I allows me to do, I prefer to use scrape whenever it is possible. Scrape is faster and sometimes more reliable. I will use RoboBrowser when I really have no choice, such as, when a site only loads content dynamically after the initial page load, via javascript calls etc. In this case scrape is useless. Or if a site requires to you log in and it maintains session variables with your login info. For this you need RoboBrowser.
This site though, loads all the content we need in the initial call so scrape is really perfect, fast, and probably less likely to be broken (although that really depends on how you use it).
Here is my command for getting the "What 's on now and then later for a given channel name" using the site:
http://www.tvgids.tv/nu-en-straksMaybe mine will break too, but I tested it last night, and then again this morning and it seems to work. This command is designed to work with a payloadXML file and you must ask for a channel by name. It is not designed to work from a channel number, so if you were going to try to detect what channel number you were already watching and then use that to see what was playing, it would need some modification. As it is I can ask "what is playing on HBO" and it will respond:
"Now:Thing Ice, Later: True Detective"I have attached the payloadXML file with (I think) all the channels. I recommend that you edit the list to remove any channels that you know you will never ever use, and to edit the phrases for the ones you do use to make sure they can be easily understood by the engine, and to create comma separated aliases for them if you like. I started at the top and edited a few. In particular, phrases for any shows that are made up of letters should be separated by spaces (H B O instead of HBO) so that the engine expects to hear them spelled out. Fox can be left as Fox since we say it like a word. In some cases, if you are not sure you could use an alias and do it both ways. On the value column, you should not edit it unless you notice that i have made a mistake. I have used . in the values for spaces because . matches any character but if you were to enter a space it would just ignore it. This is needed for the regex to work, but you could use the more accurate \s (which stands for whitespace character), I just find that using \s makes it harder to read (and is more work to type:))
Here is the command:
<?xml version="1.0" encoding="utf-16"?>
<command id="208" name="tv guide scrape" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Scrape</cmdType>
<cmdString>http://www.tvgids.tv/nu-en-straks</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>System.SetClipboardText</cmdType>
<cmdString>{LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegExSingle</cmdType>
<cmdString>title="TV.Gids.{1}".*?title="(.*?)".*?rel="nofollow".*?title="(.*?)".*?rel="nofollow"&&, Later: </cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>Now: {Match.1}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<cmdString>Now: {Match.1}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>what is playing on</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\nustraks.xml</payloadFromXML>
</command>
Dave: See if you can use this technique with your other site but let me know if you need help. I enjoy these puzzles.