wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
yum install bzip2 # 安装bzip2
tar -jxvf phantomjs-2.1.1-linux-x86_64.tar.bz2
mv phantomjs-2.1.1-linux-x86_64 /usr/local/src/phantomjs
ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
yum install fontconfig freetype2
phantomjs -v # 测试版本号
简单的python selenium 运用
from selenium import webdriver
driver=webdriver.PhantomJS(executable_path='/usr/local/bin/phantomjs')
driver.get('')
driver.find_element_by_id("").clear()
driver.find_element_by_id("").send_keys('')
driver.find_element_by_xpath("").click()
网友评论