Giter Site home page Giter Site logo

chromote's Issues

KeyError: 'webSocketDebuggerUrl'

Hi, sometimes this exception is yield:

Traceback (most recent call last):
  File "D:\sources\personal\www\www.todotrucos.info\posts\foo_post.py", line 33, in <module>
    wpp.run(filename=__file__, post_content=POST, tags=[], post_status="draft")
  File "D:\sources\personal\python\framework\web\wp_lib.py", line 280, in run
    print chrome.tabs
  File "d:\virtual_envs\py2710\lib\site-packages\chromote\__init__.py", line 122, in tabs
    return tuple(self._get_tabs())
  File "d:\virtual_envs\py2710\lib\site-packages\chromote\__init__.py", line 106, in _get_tabs
    yield ChromeTab(tab['title'], tab['url'], tab['webSocketDebuggerUrl'])
KeyError: 'webSocketDebuggerUrl'

And the code yielding that exception is very basic

chrome = Chromote()
print chrome.tabs

As i said, it happens sometimes but i don't know, any clue why?

Regards

Chrome wont start with debugging

I couldn't get Chrome to start with the remote debugging port enabled. I finally realized that you have to kill any chrome processes on Windows first, before you can start Chrome with the remote debugging port enabled. I thought others may benefit from this info.

Add new version number to current code

Could you please add a new version number to the current code? Currently, pip install chromote installs version 0.3.0, which is missing the add_tab, close_tab functionality implemented in commit #13.

Using chromote for multiple Chrome processes with different debugger ports?

Is it possible to use Chromote for multiple Chrome processes with different debugger ports? For example, if I open two new Chrome windows with debugger port 9222 and port 9223, can I create two Chromote instances in a single parent process and connect them to their respective browser processes?

The reason for this is that I want to use Chromote as a load testing tool for a web application, where a number of clients open up browsers and remote control them simultaneously.

in `_send`, should `Runtime.evaluate` take `"returnByValue": False`?

This is perhaps more of a question than an issue, but in my project, I need to add "returnByValue": False, at around line 72 in __init__.py:

(note, I'm adding line breaks only to make it easier to read)

def evaluate(self, javascript):
    """
    Evaluate JavaScript on the page
    """
    return self._send(
        {"method": "Runtime.evaluate", 
         "params": {"expression": javascript, 
            "returnByValue": False}})        # <---- This bit

Without this, I don't get back the full string contents of returned data, e.g. the results of Array maps and so on. I'm happy to make a PR to make this a setting (e.g. an extra param on evaluate, with default set to True), but just wanted to find out your thoughts?

Documentation?

Is the full documentation available anywhere for the API?

I am looking for a way to open multiple tabs and cycle between them, preferably without reloading the tab each time.

Post request use chromote

Hi, thanks for your job!
By using chromote, i can set a url to remote Chrome(in docker container) and return a html code, but i can't sent a post request to the chrome, do you have any idea? Thanks again!

example: How can i get a logged-in page when i send a login url to remote headless Chrome?

cannot use chrome.tabs

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.