#使用Selenium获取Cookie配合requests进行操作
import requests
from selenium import webdriver
driver = webdriver.PhantomJS()
driver.get('page_with_download_link')
download_link = driver.find_element_by_id('download_link')
session = requests.Session()
cookies = driver.get_cookies()
for cookie in cookies:
session.cookies.set(cookie['name'], cookie['value'])
response = session.get(download_link)
python在phantomJs下无法进行下载,可以将Cookie传递给requests等模块进行操作。