Найти - Пользователи
Полная версия: phantomjs + заголовки
Начало » Python для новичков » phantomjs + заголовки
1
gelius
Использую phantomjs в связке с селениум.
Как отправить свои хттп заголовки?
ajib6ept
from selenium import webdriver
webdriver.DesiredCapabilities.PHANTOMJS['phantomjs.page.customHeaders.Accept-Language'] = 'ru-RU'
driver = webdriver.PhantomJS()
driver.get('http://httpbin.org/headers')
print(driver.page_source)

PhantomJS 1.9.2+
http://stackoverflow.com/questions/17858663/custom-headers-in-phantomjs-selenium-webdriver

Проверил, у меня на 2.0 заголовок поменялся
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB