from urllib import urlopen
from bs4 import BeautifulSoup
from selenium import webdriver

def getBeautifulSoupObject(link):
    html = urlopen(link)
    return BeautifulSoup(html)

def getDynamicContent(link):
    driver = webdriver.PhantomJS()
    driver.get(link)


link = "https://www.dnainfo.com/chicago/2017-chicago-murders"

getDynamicContent(link)
@@ -1,30 +1,19 @@
-from urllib import urlopen
+import requests
 %0Afro
@@ -71,16 +71,119 @@
 driver%0A%0A
+import logging%0Alogging.basicConfig(filename='scrape.log',level=20)%0Alogging.info('Initialized logger')%0A%0A
 def getB
@@ -223,15 +223,20 @@
 l = 
-urlopen
+requests.get
 (lin
@@ -295,24 +295,37 @@
 tent(link):%0A
+    try:%0A    
     driver =
@@ -355,25 +355,292 @@
     
-driver.get(link)%0A
+    logging.info(%22Webdriver initiated %7B0%7D%22.format(driver))%0A    except Exception as exp:%0A        logging.fatal(%22Webdriver exception: %7Bexception%7D%22.format(exception=exp))%0A        raise exp%0A    driver.get(link)%0A    #REMOVELATER: test if we are able to get the title%0A    print driver.title
 %0A%0Ali

Add logging, requests and handle exceptions