As selenium is something I have never used before I found that there is no need of BeautifulSoup in this particular case.
from selenium import webdriver url = "https://www.packtpub.com/packt/offers/free-learning" driver = webdriver.PhantomJS() driver.get(url) book_title = driver.find_element_by_tag_name('h2').text expire_time = driver.find_element_by_class_name('packt-js-countdown').text print('The free book for today from https://www.packtpub.com is') print('"{}"'.format(book_title)) print('Expire in: {}'.format(expire_time))