from selenium import web driver
from browsermobproxy import Server
from selenium.webdriver.common.by import By
import json
import time
server = Server(r'D:\browsermob-proxy-2.1.4\bin\browsermob-proxy.bat')
server.start()
proxy = server.create_proxy({'captureHeaders': True, 'captureContent': True, 'captureBinaryContent': True})
profile = webdriver.FirefoxProfile()
profile.set_proxy(proxy.selenium_proxy())
driver = webdriver.Firefox(firefox_profile=profile)
proxy.new_har('xxx')
driver.get('XXX')
proxy.wait_for_traffic_to_stop(1, 60)
这就是我得到的全部:
我想从正文中获得响应但失败了,我需要设置任何参数吗?