简体   繁体   中英

How to replay server response from .har file?

I am new to this, this is my first question here. Please guide me to improve.

Learning python automation. Came across scenario to automate "replay server response from.har file" .

Could capture, HAR file

from browsermobproxy import Server

server = Server("~/browsermob-proxy")

server.start()
proxy = server.create_proxy()

from selenium import webdriver
co = webdriver.ChromeOptions()
co.add_argument('--proxy-server={host}:{port}'.format(host='localhost', port=proxy.port))

driver = webdriver.Chrome(executable_path = "~/chromedriver", chrome_options=co)

proxy.new_har
driver.get(url)
proxy.har

How can I replay server response from captured HAR file (offline)? Is it possible with python or any other? And what's the significance of replay server response?

Could you please help me?

Check out this https://github.com/louisabraham/har2requests . It should convert the.har file into a python script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM