selenium phantomjs demo

code

import sys,os

sys.path.append("/".join(os.path.dirname(os.path.abspath(__file__)).split("/")[:-1])+'/lib')
from selenium import webdriver

import time

from selenium.webdriver.common.keys import Keys



driver = webdriver.PhantomJS()


time.sleep(2)


driver.get("http://cn.bing.com/")
title_=driver.title
print(title_)
driver.close()

原文地址:https://www.cnblogs.com/sea-stream/p/14181582.html