Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dict in get_screenshot method #120

Open
FRiMN opened this issue Mar 27, 2021 · 3 comments
Open

Dict in get_screenshot method #120

FRiMN opened this issue Mar 27, 2021 · 3 comments

Comments

@FRiMN
Copy link

FRiMN commented Mar 27, 2021

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
Copy link
Contributor

dimaqq commented Mar 29, 2021

That's not good 😆

@dimaqq
Copy link
Contributor

dimaqq commented Mar 29, 2021

@FRiMN could you provide a MRE?

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

  • ChromeDriver 89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294})
  • arsenic==20.9
  • aiohttp==3.7.4.post0

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
Copy link
Contributor

dimaqq commented Jun 16, 2021

I'm considering to close this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants