Here is my code (at the final stage):
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Text;
using System.Threading.Tasks;
namespace BBC_W_FCast_New_01
{
class Program
{
static void Main(string[] args)
{
//Instantiate Firefox Driver
var driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://www.bbc.co.uk/weather");
//Using the 'Find a Forecast' search field to get the weather in 'Reading, UK'
var user = driver.FindElement(By.Id("locator-form-search"));
//Use "Reading, Reading" to avoid ambiguity. There is a location called Reading in USA
user.SendKeys("Reading, Reading");
//Click on Search button
driver.FindElement(By.Id("locator-form-submit")).Click();
//Click on Table button
driver.FindElement(By.Id("detail-table-view")).Click();
//Obtaining pressure For 2100 hours today
driver.FindElement(By.XPath("//*[@id='hourly']/div[3]/table/tfoot/tr[3]/td[10]")).Click();
//Obtain pressure for 2100 Hours tomorrow
driver.FindElement(By.XPath("//*[@id='hourly']/div[3]/table/tfoot/tr[3]/td[16]")).Click();
//Subtract the two values above and then 'echo' the result in Selenium
int val1 = Int32.Parse(driver.FindElement(By.XPath("//*[@id='hourly']/div[3]/table/tfoot/tr[3]/td[16]")).Text);
int val2 = Int32.Parse(driver.FindElement(By.XPath("//*[@id='hourly']/div[3]/table/tfoot/tr[3]/td[10]")).Text);
int difference = val1 - val2;
System.Console.WriteLine("Difference is: " + difference);
}
}
}