selenium-wire icon indicating copy to clipboard operation
selenium-wire copied to clipboard

"LookupError: unknown encoding: amz-1.0" in mitmproxy code

Open toabctl opened this issue 3 years ago • 2 comments

Using selenium-wire 4.5.6 and trying the get some data from AWS quickstart, I ran into:

Exception in thread Http2SingleStreamLayer-29:
Traceback (most recent call last):
  File "aws-marketplace-ubuntu-scraper/venv/lib/python3.9/site-packages/seleniumwire/thirdparty/mitmproxy/net/http/encoding.py", line 62, in decode
    decoded = custom_decode[encoding](encoded)
KeyError: 'amz-1.0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aws-marketplace-ubuntu-scraper/venv/lib/python3.9/site-packages/seleniumwire/thirdparty/mitmproxy/net/http/encoding.py", line 64, in decode
    decoded = codecs.decode(encoded, encoding, errors)  # type: ignore
LookupError: unknown encoding: amz-1.0

toabctl avatar Dec 13 '21 16:12 toabctl

Thanks for raising this.

The content encoding amz-1.0 isn't currently supported, but we can look at adding support for that. In the meantime you may be able to workaround the problem by setting the disable_encoding option in the seleniumwire_options.

wkeeling avatar Dec 13 '21 17:12 wkeeling

the workaround does not change anything. I use now:

seleniumwire_options = {
    'disable_encoding': True
}
driver = webdriver.Firefox(options=driver_options,
                               seleniumwire_options=seleniumwire_options)

Still the same problem.

toabctl avatar Dec 13 '21 17:12 toabctl

@toabctl do you have a workaround for this issue ??? I am, too facing the same issue.

pawanpaudel93 avatar Nov 21 '22 04:11 pawanpaudel93