HENNGE / arsenic

Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Other
349 stars 52 forks source link

Dict in get_screenshot method #120

Open FRiMN opened 3 years ago

FRiMN commented 3 years ago

When I try to call method Session.get_screenshot():

python_1  |   File "/usr/local/lib/python3.7/site-packages/arsenic/session.py", line 300, in get_screenshot
python_1  |     base64.b64decode(await self._request(url="/screenshot", method="GET"))
python_1  |   File "/usr/local/lib/python3.7/base64.py", line 80, in b64decode
python_1  |     s = _bytes_from_decode_data(s)
python_1  |   File "/usr/local/lib/python3.7/base64.py", line 46, in _bytes_from_decode_data
python_1  |     "string, not %r" % s.__class__.__name__) from None
python_1  | TypeError: argument should be a bytes-like object or ASCII string, not 'dict'

I guess it is dict in data returned from RequestHelpers.connection.request().

Response is:

{
    "message": "invalid session id\n  (Driver info: chromedriver=73.0.3683.75,platform=Linux 5.4.0-65-generic x86_64)"
}
dimaqq commented 3 years ago

That's not good 😆

dimaqq commented 3 years ago

@FRiMN could you provide a MRE?

I was not able to reproduce, I've tried the newest versions:

I've added xx = await driver.get_screenshot() to a random existing test that uses arsenic and that produced a valid io.BytesIO with sane length.

dimaqq commented 3 years ago

I'm considering to close this...