steinnes / bord Goto Github PK
View Code? Open in Web Editor NEWchromium/pyppeteer based dashboard runner
chromium/pyppeteer based dashboard runner
By default pypetteer (or chrome) creates a blank new chrome profile when launched. This probably impacts performance and over time (restarts) wastes disk space. Let's examine whether a fixed chrome profile path can be used with the userDataDir
chrome launch parameter.
[I:pyppeteer.launcher] Browser listening on: ws://127.0.0.1:44733/devtools/browser/18a17659-2e38-48d8-8034-a3452a519a0a
ATTENTION: default value of option force_s3tc_enable overridden by environment.
[1356:1356:0511/092504.122843:ERROR:sandbox_linux.cc(364)] InitializeSandbox() called with multiple threads in process gpu-process.
** Message: wlan0: Received scan results
** Message: wlan0: Received scan results
[E:pyppeteer.connection] connection unexpectedly closed
Task exception was never retrieved
future: <Task finished name='Task-550' coro=<Connection._async_send() done, defined at /home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/pyppeteer/connection.py:69> exception=InvalidStateError('invalid state')>
Traceback (most recent call last):
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/websockets/protocol.py", line 827, in transfer_data
message = await self.read_message()
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/websockets/protocol.py", line 895, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/websockets/protocol.py", line 971, in read_data_frame
frame = await self.read_frame(max_size)
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/websockets/protocol.py", line 1047, in read_frame
frame = await Frame.read(
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/websockets/framing.py", line 105, in read
data = await reader(2)
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/asyncio/streams.py", line 721, in readexactly
raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/pyppeteer/connection.py", line 73, in _async_send
await self.connection.send(msg)
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/websockets/protocol.py", line 555, in send
await self.ensure_open()
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/websockets/protocol.py", line 803, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/pyppeteer/connection.py", line 79, in _async_send
await self.dispose()
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/pyppeteer/connection.py", line 170, in dispose
await self._on_close()
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/pyppeteer/connection.py", line 151, in _on_close
cb.set_exception(_rewriteError(
asyncio.exceptions.InvalidStateError: invalid state
Reloading: Screen(url='xxxxx', display_time=30, refresh_interval=900)
Traceback (most recent call last):
File "/home/pi/.pyenv/versions/3.8.1/bin/bord", line 10, in <module>
sys.exit(main())
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/bord/cli.py", line 15, in main
bord(_anyio_backend="asyncio")
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/asyncclick/core.py", line 799, in __call__
return anyio.run(self._main, main, args, kwargs, backend=_anyio_backend)
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/anyio/__init__.py", line 68, in run
return asynclib.run(func, *args, **backend_options) # type: ignore
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 96, in run
raise exception
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 66, in wrapper
retval = await func(*args)
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/asyncclick/core.py", line 802, in _main
return await main(*args, **kwargs)
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/asyncclick/core.py", line 748, in main
rv = await self.invoke(ctx)
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/asyncclick/core.py", line 994, in invoke
return await ctx.invoke(self.callback, **ctx.params)
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/asyncclick/core.py", line 588, in invoke
rv = await rv
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/bord/cli.py", line 11, in bord
await Bord(config).start()
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/bord/bord.py", line 54, in start
await self.rotate()
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/bord/bord.py", line 66, in rotate
await tab.display()
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/bord/bord.py", line 25, in display
await self.tab.reload()
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/pyppeteer/page.py", line 906, in reload
response = (await asyncio.gather(
File "/home/pi/.pyenv/versions/3.8.1/lib/python3.8/site-packages/pyppeteer/page.py", line 963, in waitForNavigation
raise error
pyppeteer.errors.TimeoutError: Navigation Timeout Exceeded: 30000 ms exceeded.
[I:pyppeteer.launcher] terminate chrome process...
Please add
ignoreDefaultArgs=["--enable-automation"],
to the browser_kwargs
dict in bord.py
I've been unable to get this project to work on my macbook. The screeninfo
package appears to depend on a package that I cannot install.
As far as I can tell, the screeninfo
package is used to find the width and height of the screen, which is then used when setting the size of the viewport in chromium. However, I've found that supplying the defaultViewport=None,
keyword argument when launching chromium alleviates the need for manually setting the viewport size.
os.uname for OS detection is fragile since the method does not exist on non-unix systems, relying on sys.platform would be much safer:
(https://docs.python.org/3/library/sys.html#sys.platform)
Both datadog and amplitude have TV modes. As far as I understand, the Amplitude TV mode cannot be enabled via querystring. It might be possible to automate the clicking of this TV-mode button. We could attempt a generic search for a clickable element mentioning 'TV' or we could extend the config, making it possible to specify a CSS selector or something similar that points to an element that should be clicked.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.