from selenium import webdriver
import time
browser=webdriver.PhantomJS()
browser.get('http://yandex.ru')
browser.quit()
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
browser = webdriver.PhantomJS()
browser.set_page_load_timeout(30)
try:
browser.get('https://yandex.ru')
except TimeoutException:
print("can't load page")
browser.quit()