const string url = "http://msg.urbtix.hk/";
const string retryTitle = "請再登入 Please access again";
static void Main(string[] args)
var firefox = new OpenQA.Selenium.Firefox.FirefoxDriver();
Func<IWebElement, bool> assertTitle = (elem) => { return elem != null && elem.Text.Contains(retryTitle); };
Func<IWebElement> findPageTitle = () => { return firefox.FindElementByCssSelector("td.page-title"); };
var pageTitle = findPageTitle();
while (assertTitle(pageTitle))
var button = firefox.FindElementById("to-main-btn");
Console.WriteLine(string.Format("{0} read.", ++counter));
pageTitle = findPageTitle();
Console.WriteLine("Loaded.");