# coding: utf-8
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from multiprocessing import Process
driver = webdriver.PhantomJS(executable_path=r"你phantomjs的可执行文件路径")
# 请求一个网址
driver.get("http://fund.eastmoney.com/fund.html")
page_text = driver.find_element_by_id("pager").find_element_by_xpath("span[@class='nv']").text
total_page = ''.join(filter(str.isdigit,page_text)) # 得到总共有多少页
# 循环抓取网页内容的函数
def getData(myrange):
for x in myrange:
# 去第几页 输入框
tonum = driver.find_element_by_id("tonum")
# 去第几页 提交按钮
jumpBtn = driver.find_element_by_id("btn_jump")
tonum.clear() # 第x页 输入框
tonum.send_keys(str(x)) # 去第x页</