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

cannot use chrome.tabs #10

Open
MattMcFarland opened this issue Jun 6, 2017 · 2 comments
Open

cannot use chrome.tabs #10

MattMcFarland opened this issue Jun 6, 2017 · 2 comments

Comments

@MattMcFarland
Copy link

MattMcFarland commented Jun 6, 2017

Hey, thanks for making this repo. I tried to run but I'm running into an issue:

>>> from chromote import Chromote
>>> chrome = Chromote()
>>> chrome
Chromote(host="localhost", port=9222)
>>> print chrome

According to readme, I should see the following:

[Chromote(tabs=1)]

But instead, I see this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/chromote/__init__.py", line 156, in __str__
    return '[Chromote(tabs=%d)]' % len(self)
  File "/usr/local/lib/python3.6/site-packages/chromote/__init__.py", line 153, in __len__
    return len(self.tabs)
  File "/usr/local/lib/python3.6/site-packages/chromote/__init__.py", line 150, in tabs
    return tuple(self._get_tabs())
  File "/usr/local/lib/python3.6/site-packages/chromote/__init__.py", line 132, in _get_tabs
    for tab in res.json():
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 886, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Tried this in python 2.7 and got the same result as well.

Any ideas????

Thanks!

@MattMcFarland MattMcFarland changed the title Hi cannot use chrome.tabs Jun 6, 2017
@iiSeymour
Copy link
Owner

Hey, do you have the developer tools open in chrome at the same time as running chromote?

@MattMcFarland
Copy link
Author

Hi, no not at all, in fact I was using this to connect to headless chrome. Is that the problem?

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