Python

Selenium Wire

Kyle79 2022. 12. 11. 14:43

 

https://pypi.org/project/selenium-wire/

 

selenium-wire

Extends Selenium to give you the ability to inspect requests made by the browser.

pypi.org

 

for s in chrome.get_requests():
    if s.response and s.response.status_code == 200
        if 'gzip' in s.response.headers.get('Content-Encoding', '').lower():
            api_response_body = gzip.decompress(s.response.body)
            set_api_headers = dict(s.headers)
        else:
            api_response_body = s.response.body

'Python' 카테고리의 다른 글

한글 인코딩 깨지는 경우  (0) 2023.03.02
BrowserMob Proxy  (0) 2022.12.11
User-agent generator  (0) 2022.12.11
Selenium Wire Option  (2) 2022.12.11
Selenium Chrome Option  (0) 2022.12.11