from selenium import webdriver
from selenium.webdriver.common.keys import Keys

# Assuming you want the standard rate

# Steps to find call cost
# 1. Navigate to the link:
#   http://international.o2.co.uk/internationaltariffs/calling_abroad_from_uk
# 2. Using input#countryName...
# 3. Enter the country name and press Enter
# 4. Click a#paymonthly
# 5. Look in table#standardRatesTable for
#    <td>Landline</td><td>*XXXX*</td>

class CallCostScraper:
    def __init__(self, target_url):
        self.driver = webdriver.Firefox()
        self.target_url = target_url
        self.load_page()
    
    def load_page(self):
        self.driver.get(self.target_url)
    
    def input_country(self, country):
        pass
        
    def find_rate(self):
        pass
    
    def get_country_price(self, country):
        self.input_country(country)
        self.find_rate()
    
    pass

scraper = CallCostScraper("http://international.o2.co.uk/internationaltariffs/calling_abroad_from_uk")
scraper.get_country_price("Canada")

@@ -1,20 +1,36 @@
+# coding: utf-8%0A
 from selenium import
@@ -122,20 +122,58 @@
 tandard 
-rate
+landline rate on a pay monthly contract...
 %0A%0A# Step
@@ -637,28 +637,24 @@
 load_page()%0A
-    
 %0A    def loa
@@ -708,20 +708,16 @@
 et_url)%0A
-    
 %0A    def
@@ -759,64 +759,498 @@
     
-pass%0A        %0A    def find_rate(self):%0A        pass%0A    
+input_elem = self.driver.find_element_by_id(%22countryName%22)%0A        # TODO: Check if element is the input we're after%0A        input_elem.clear()%0A        input_elem.send_keys(country)%0A        input_elem.send_keys(Keys.RETURN)%0A%0A        self.driver.implicitly_wait(5) # seconds%0A        paym_elem = self.driver.find_element_by_id(%22paymonthly%22)%0A        paym_elem.click()%0A%0A    def find_rate(self):%0A        table_elem = self.driver.find_element_by_id(%22standardRatesTable%22)%0A%0A        return u%22%C2%A31.50%22%0A
 %0A   
@@ -1328,24 +1328,31 @@
 ry)%0A        
+return 
 self.find_ra
@@ -1356,20 +1356,16 @@
 _rate()%0A
-    
 %0A    pas
@@ -1470,16 +1470,31 @@
 om_uk%22)%0A
+canada_price = 
 scraper.
@@ -1521,8 +1521,60 @@
 anada%22)%0A
+print(%22Price for Canada: %22 + unicode(canada_price))%0A

Flesh out input_country to search for the given country name.