phantomjs下载地址
简单的代码示例
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from selenium import webdriver
import time
executable_path = 'plugin/phantomjs-2.1.1-macosx/bin/phantomjs'
driver = webdriver.PhantomJS(executable_path)
url = ''
driver.get(url)
time.sleep(15)
pageSource = driver.page_source
print("info:", driver.find_element_by_id('id').text)
driver.close()
python抓取js加载的数据