phantomjs 2.1.1
python 2.7.11
在phantomjs的文档中,我看到了:
var webPage = require('webpage');
var page = webPage.create();
var postBody = 'user=username&password=password';
page.open('http://www.google.com/', 'POST', postBody, function(status) {
console.log('Status: ' + status);
// Do other things here...
});
但是在python包中,我找不到“open”功能。如果我想使用python的phantomjs发布数据,我该怎么办?
我使用像这样的phantomjs:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
...
dcap = dict(DesiredCapabilities.PHANTOMJS)
dcap["phantomjs.page.customHeaders"] = headers
driver = webdriver.Remote(command_executor='http://127.0.0.1:8910', // conect with docker
# desired_capabilities=DesiredCapabilities.PHANTOMJS)
desired_capabilities=dcap)