Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. Puppeteer: Screenshots PhantomJS Alternative

    NEWS

    • 15. 05. Wartungsarbeiten am ioBroker Forum

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    Puppeteer: Screenshots PhantomJS Alternative

    This topic has been deleted. Only users with topic management privileges can see it.
    • foxriver76
      foxriver76 Developer @arteck last edited by

      @arteck Okay, dann habe ich erst mal keine Idee, wie ich das allgemein fixen kann.

      Du könntest für dich speziell, diese Lösung probieren und rückmelden ob das tut: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#recommended-enable-user-namespace-cloning

      arteck 1 Reply Last reply Reply Quote 0
      • arteck
        arteck Developer Most Active @foxriver76 last edited by

        @foxriver76 ich geh mal auf bullseye mal schauen dann..

        crunchip 1 Reply Last reply Reply Quote 0
        • crunchip
          crunchip Forum Testing Most Active @arteck last edited by

          @arteck sagte in Puppeteer: Screenshots PhantomJS Alternative:

          bullseye

          damit läufts bei mir , siehe https://forum.iobroker.net/post/812880

          1 Reply Last reply Reply Quote 0
          • arteck
            arteck Developer Most Active last edited by

            mit bullseye läuft der ...

            Thomas Braun 1 Reply Last reply Reply Quote 0
            • Thomas Braun
              Thomas Braun Most Active @arteck last edited by

              @arteck sagte in Puppeteer: Screenshots PhantomJS Alternative:

              mit bullseye läuft der ...

              Und deswegen predige ich ja auch immer nicht an abgekündigten Versionen festzuhalten und die Kisten auf Stand zu halten. Bringt nix sich da mit obsoletem Kram zu beschäftigen.

              arteck 1 Reply Last reply Reply Quote 0
              • arteck
                arteck Developer Most Active @Thomas Braun last edited by

                @thomas-braun dir auch schöne Feiertage 🙂

                1 Reply Last reply Reply Quote 1
                • arteck
                  arteck Developer Most Active last edited by arteck

                  @foxriver76 so weiter gehts
                  e6bd6490-6cbf-4990-abca-894829a34c3c-grafik.png

                  puppeteer.0
                  2022-12-22 11:08:33.619	debug	Write file to "wetterstation.png"
                  
                  puppeteer.0
                  2022-12-22 11:08:32.470	debug	Message: {"command":"screenshot","message":{"url":"https://www.yr.no/en/forecast/graph/2-2860410/Germany/North%20Rhine-Westphalia/D%C3%BCsseldorf%20District/Oberhausen","clip":{"x":0,"y":0,"width":1000,"height":757},"ioBrokerOptions":{"storagePath":"wetterstation.png"},"viewportOptions":{"width":1600,"height":1000}},"from":"system.adapter.javascript.2","callback":{"message":{"url":"https://www.yr.no/en/forecast/graph/2-2860410/Germany/North%20Rhine-Westphalia/D%C3%BCsseldorf%20District/Oberhausen","clip":{"x":0,"y":0,"width":1000,"height":757},"ioBrokerOptions":{"storagePath":"wetterstation.png"},"viewportOptions":{"width":1600,"height":1000}},"id":1,"ack":false,"time":1671703712468},"_id":69097945}
                  javascript.2
                  2022-12-22 11:14:19.409	info	script.js.80_system.wetter: Sucessfully took screenshot: �PNG   IHDR��T��sRGB��� IDATx���wTW�g�� MT�bD��bCE콠1�X�+ػb7{7�`�b�(��^������0�� ����w�Gv��̝;w޹edB"""""""�S��1@'""""""� Љ�������t"""""""-��������H0@'""""""�Љ�������t"""""""-��������H0@'""""""�Љ�������t"""""""-��������H0@'""""""�Љ�������t"""""""-��������H0@'""""""�Љ�������t"""""""-��������H0@'""""""�Љ�������t"""""""-��������H0@'""""""�Љ��.........
                  

                  sieht eigentlich gut aus..ich hab das binary gekürzt..

                  aber kein file und die datenpunkte sind auch nicht gefüllt

                  sendTo('puppeteer.0', 'screenshot', { 
                          url: 'https://www.yr.no/en/forecast/graph/2-2860410/Germany/North%20Rhine-Westphalia/D%C3%BCsseldorf%20District/Oberhausen',
                          clip: {
                              x: 0,
                              y: 0,
                              width: 1000,
                              height: 757
                          },
                          ioBrokerOptions: {
                              storagePath: 'wetterstation.png',
                          },
                          viewportOptions: {
                              width: 1600,
                              height: 1000
                          }
                      }, obj => {
                        if (obj.error) {
                          log(`Error taking screenshot: ${obj.error.message}`, 'error');
                        } else {
                          // the binary representation of the image is contained in `obj.result`
                          log(`Sucessfully took screenshot: ${obj.result}`);
                        }
                  });
                  

                  so rufe ich es auf ..sollte also in /opt/iobroker/iobroker-data/files/0_userdata.0 landen..ist aber nix da

                  foxriver76 1 Reply Last reply Reply Quote 0
                  • foxriver76
                    foxriver76 Developer @arteck last edited by foxriver76

                    @arteck Siehe:

                    https://github.com/foxriver76/ioBroker.puppeteer#how-to

                    States dienen nur der Konfiguration, falls du via States (sprich das setzen der url) einen Screenshot erstellen möchtest. Wenn du ausschließlich Messages nutzt können dir die States egal sein.

                    Nutzt du eine Redis DB für die Objekte?

                    arteck 1 Reply Last reply Reply Quote 0
                    • arteck
                      arteck Developer Most Active @foxriver76 last edited by

                      @foxriver76 jo Redis

                      ich wollte mir nur ein Bild des meteogramms machen und in die Vis pressen

                      foxriver76 1 Reply Last reply Reply Quote 0
                      • foxriver76
                        foxriver76 Developer @arteck last edited by

                        @arteck Wenn Objekte in Redis, dann werden Dateien nicht raw auf dem FS abgespeichert, unabhängig vom Adapter. Du solltest diese z. B. im Admin in Dateien unter Benutzerdaten finden.

                        arteck foxriver76 2 Replies Last reply Reply Quote 0
                        • arteck
                          arteck Developer Most Active @foxriver76 last edited by

                          @foxriver76 recht hast du ja

                          da wo man es hinschiebt ist es auch
                          20aa4f16-ff00-4f1c-9b61-1722141414ad-grafik.png

                          1 Reply Last reply Reply Quote 0
                          • foxriver76
                            foxriver76 Developer @foxriver76 last edited by

                            @foxriver76 Falls du es auf dem FS haben möchtest, kannst du die Option path auf Top Level mitgeben. Ist dann Puppeteer intern abgehandelt: https://pptr.dev/api/puppeteer.screenshotoptions.path

                            arteck 1 Reply Last reply Reply Quote 0
                            • arteck
                              arteck Developer Most Active @foxriver76 last edited by arteck

                              @foxriver76 ok

                              aber verstehe jetzt nicht die Nutzung der Datenpunkte ??

                              wenn ich alle 60 min ein bild haben will.. was nutz ich da.. stehe bissel auf dem Schlauch

                              foxriver76 2 Replies Last reply Reply Quote 0
                              • foxriver76
                                foxriver76 Developer @arteck last edited by

                                @arteck Wenn du nicht so der "Skript Typ" bist, kannst du einige der oft genutzten Optionen direkt über die Datenpunkte festlegen und dann schreibst du eine url in den url state und ein Screenshot wird erstellt. Das ist etwas angelehnt an die Logik vom Phantom.JS Adapter, soweit ich mich erinnere.

                                Mit sendTo hast du deutlich mehr Optionen zur Verfügung und bekommst z. B. auch das Bild direkt im Callback falls du es codetechnsich weiterverarbeiten möchtest.

                                1 Reply Last reply Reply Quote 0
                                • foxriver76
                                  foxriver76 Developer @arteck last edited by

                                  @arteck Es gibt keine Option, das regelmäßig festzulegen.

                                  Sprich du würdest dein Code (entweder setState auf den url State oder dein sendTo) in einen schedule packen der jede Minute triggered oder im Callback von der Funktion die Funktion mit setTimeout in 60 Sekunden erneut aufrufen

                                  arteck 1 Reply Last reply Reply Quote 0
                                  • arteck
                                    arteck Developer Most Active @foxriver76 last edited by arteck

                                    @foxriver76 ahh ok.. jetzt ja..THX

                                    1 Reply Last reply Reply Quote 0
                                    • Neuschwansteini
                                      Neuschwansteini @foxriver76 last edited by

                                      @foxriver76

                                      Hi,

                                      Hab die v0.2.6 im Docker mal installiert, leider meckert er beim installieren schon, dass die Version veraltet ist und empfiehlt >19.2 zu installieren..

                                      Machst du mal n Update, so funktioniert der Adapter im Docker nicht..?
                                      Log kann ich gerne nachreichen

                                      foxriver76 1 Reply Last reply Reply Quote 0
                                      • foxriver76
                                        foxriver76 Developer @Neuschwansteini last edited by

                                        @ilovegym keine Ahnung welche Version du meinst, gerne Log zeigen

                                        Neuschwansteini 1 Reply Last reply Reply Quote 0
                                        • Neuschwansteini
                                          Neuschwansteini @foxriver76 last edited by

                                          @foxriver76

                                          Bin am Tablett mit meinen dicken Fingern.. verwende den buanet Docker mit Node 16
                                          hier beim installieren:

                                          host.iobroker
                                          2023-03-18 21:09:38.495	info	iobroker npm WARN deprecated puppeteer@13.7.0: < 19.2.0 is no longer supported
                                          
                                          

                                          Dann beim starten des Adapter:

                                          
                                          puppeteer.0
                                          2023-03-18 21:10:24.951	error	Error: Failed to launch the browser process![0318/211024.570664:FATAL:zygote_host_impl_linux.cc(117)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.#0 0x55aca5667b89 base::debug::CollectStackTrace()#1 0x55aca55cc433 base::debug::StackTrace::StackTrace()#2 0x55aca55df330 logging::LogMessage::~LogMessage()#3 0x55aca35c499b content::ZygoteHostImpl::Init()#4 0x55aca5175372 content::ContentMainRunnerImpl::Initialize()#5 0x55aca5173439 content::RunContentProcess()#6 0x55aca517358e content::ContentMain()#7 0x55aca51ced7a headless::(anonymous namespace)::RunContentMain()#8 0x55aca51cea85 headless::HeadlessShellMain()#9 0x55aca1c323e8 ChromeMain#10 0x7effdda9dd0a __libc_start_main#11 0x55aca1c3222a _startTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md at onClose (/opt/iobroker/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241:20) at Interface.<anonymous> (/opt/iobroker/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:231:68) at Interface.emit (node:events:525:35) at Interface.close (node:readline:590:8) at Socket.onend (node:readline:280:10) at Socket.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)
                                          
                                          puppeteer.0
                                          2023-03-18 21:10:24.950	error	unhandled promise rejection: Failed to launch the browser process![0318/211024.570664:FATAL:zygote_host_impl_linux.cc(117)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.#0 0x55aca5667b89 base::debug::CollectStackTrace()#1 0x55aca55cc433 base::debug::StackTrace::StackTrace()#2 0x55aca55df330 logging::LogMessage::~LogMessage()#3 0x55aca35c499b content::ZygoteHostImpl::Init()#4 0x55aca5175372 content::ContentMainRunnerImpl::Initialize()#5 0x55aca5173439 content::RunContentProcess()#6 0x55aca517358e content::ContentMain()#7 0x55aca51ced7a headless::(anonymous namespace)::RunContentMain()#8 0x55aca51cea85 headless::HeadlessShellMain()#9 0x55aca1c323e8 ChromeMain#10 0x7effdda9dd0a __libc_start_main#11 0x55aca1c3222a _startTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
                                          
                                          
                                          foxriver76 F 2 Replies Last reply Reply Quote 0
                                          • foxriver76
                                            foxriver76 Developer @Neuschwansteini last edited by

                                            @ilovegym Krass, die sind tatsächlich innerhalb von einem Jahr von 13 auf 19.

                                            Ich habe eben eine 0.2.7 auf den Weg geschickt, gerne ausprobieren.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            861
                                            Online

                                            31.6k
                                            Users

                                            79.4k
                                            Topics

                                            1.3m
                                            Posts

                                            browser headless phantomjs puppeteer screenshot screenshots website
                                            23
                                            245
                                            23503
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo