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

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Puppeteer: Screenshots PhantomJS Alternative

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

      @foxriver76 sagte in Puppeteer: Screenshots PhantomJS Alternative:

      (z. B. Grafana Dashboards)

      und dann mit FTP auf den ext. Webspace schicken. So mach ichs für meine Wetterstation.

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

        Mit 0.2.0 ist es nun möglich, die Screenshots direkt in den ioBroker Storage (0_userdata.0 aka Benutzerdaten) zu speichern. Diese können dann im Admin unter Dateien oder mit diversen Visu Adaptern direkt aufgerufen werden. Hierzu müsst ihr aktuell Messages nutzen, was für den Adapter allgemein die mächtigere Option ist.

        Die Message müssen dazu um das Attribut ioBrokerOptions.storagePath erweitert werden. Hier könnt ihr dann z. B. screenshots/grafana-${new Date().toLocaleString()}.png angeben. Ein Message Beispiel findet ihr auch unter https://github.com/foxriver76/ioBroker.puppeteer#messages oder in kurz:

        sendTo('puppeteer.0', 'screenshot', { url: 'https://www.google.com',
              ioBrokerOptions: {
                /**
                 * Define a filename for the ioBroker storage
                 */
                storagePath: `screenshots/grafana-${new Date().toLocaleString()}.png`
              },
              /**
               * Define at most one wait option
               * You can also look for other waitOptions currently supported by Puppeteer API
               * see e.g. https://puppeteer.github.io/puppeteer/docs/puppeteer.page.waitforfilechooser
               */
              waitOption: {
                /**
                 * Define a Timeout in ms
                 */
                waitForTimeout: 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}`);
              }
        });
        
        crunchip Negalein 2 Replies Last reply Reply Quote 1
        • crunchip
          crunchip Forum Testing Most Active @foxriver76 last edited by

          @foxriver76 hab ich etwas vergessen, Adapter installiert, jedoch danach im log

          host.IoBroker
          2022-06-08 21:45:45.782	error	instance system.adapter.puppeteer.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
          puppeteer.0
          2022-06-08 21:45:45.006	warn	Terminated (UNCAUGHT_EXCEPTION): Without reason
          puppeteer.0
          2022-06-08 21:45:45.004	info	terminating
          puppeteer.0
          2022-06-08 21:45:44.922	error	Failed to launch the browser process!/opt/iobroker/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directoryTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
          puppeteer.0
          2022-06-08 21:45:44.920	error	Error: Failed to launch the browser process!/opt/iobroker/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directoryTROUBLESHOOTING: 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 (events.js:412:35) at Interface.close (readline.js:530:8) at Socket.onend (readline.js:254:10) at Socket.emit (events.js:412:35) at endReadableNT (internal/streams/readable.js:1333:12) at processTicksAndRejections (internal/process/task_queues.js:82:21)
          puppeteer.0
          2022-06-08 21:45:44.917	error	unhandled promise rejection: Failed to launch the browser process!/opt/iobroker/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directoryTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
          puppeteer.0
          2022-06-08 21:45:44.913	error	Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
          puppeteer.0
          2022-06-08 21:45:44.836	info	starting. Version 0.2.0 in /opt/iobroker/node_modules/iobroker.puppeteer, node: v14.19.3, js-controller: 4.0.23
          
          foxriver76 1 Reply Last reply Reply Quote 0
          • foxriver76
            foxriver76 Developer @crunchip last edited by

            @crunchip zeig mal Output von ldd chrome | grep not

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

              @foxriver76 sagte in Puppeteer: Screenshots PhantomJS Alternative:

              ldd chrome | grep not

              root@IoBroker:/opt/iobroker# ldd chrome | grep not
              ldd: ./chrome: Datei oder Verzeichnis nicht gefunden
              

              edit
              nicht so tragisch, muss morgen früh wieder raus, ich mach für heute Feierabend

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

                @crunchip ldd /opt/iobroker/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome | grep not

                crunchip foxriver76 2 Replies Last reply Reply Quote 0
                • crunchip
                  crunchip Forum Testing Most Active @foxriver76 last edited by crunchip

                  @foxriver76 melde mich heut Nachmittag

                  @foxriver76 Ausgabe lautet

                  root@IoBroker:/opt/iobroker# ldd /opt/iobroker/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome | grep not
                          libnss3.so => not found
                          libnssutil3.so => not found
                          libsmime3.so => not found
                          libnspr4.so => not found
                          libgbm.so.1 => not found
                  
                  
                  foxriver76 1 Reply Last reply Reply Quote 0
                  • foxriver76
                    foxriver76 Developer @crunchip last edited by foxriver76

                    @crunchip Bitte probier mal 0.2.1 und wie läuft denn ioBroker bei dir? Debian VM?

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

                      @foxriver76 ja, ist einen Debian VM(bullseye)
                      hab jetzt die v0.2.1 aus dem Repo geladen, bleibt aber dabei

                      host.IoBroker
                      2022-06-10 19:13:50.560	error	instance system.adapter.puppeteer.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
                      
                      puppeteer.0
                      2022-06-10 19:13:49.818	warn	Terminated (UNCAUGHT_EXCEPTION): Without reason
                      
                      puppeteer.0
                      2022-06-10 19:13:49.816	info	terminating
                      
                      puppeteer.0
                      2022-06-10 19:13:49.787	error	Failed to launch the browser process!TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
                      
                      puppeteer.0
                      2022-06-10 19:13:49.786	error	Error: Failed to launch the browser process!TROUBLESHOOTING: 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 ChildProcess.<anonymous> (/opt/iobroker/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:232:79) at ChildProcess.emit (events.js:412:35) at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
                      
                      puppeteer.0
                      2022-06-10 19:13:49.784	error	unhandled promise rejection: Failed to launch the browser process!TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
                      
                      puppeteer.0
                      2022-06-10 19:13:49.782	error	Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
                      
                      puppeteer.0
                      2022-06-10 19:13:49.712	info	starting. Version 0.2.1 in /opt/iobroker/node_modules/iobroker.puppeteer, node: v14.19.3, js-controller: 4.0.23
                      
                      1 Reply Last reply Reply Quote 0
                      • foxriver76
                        foxriver76 Developer @foxriver76 last edited by

                        @foxriver76 sagte in Puppeteer: Screenshots PhantomJS Alternative:

                        @crunchip ldd /opt/iobroker/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome | grep not

                        Zeig jetzt nochmal das.

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

                          @foxriver76 auch unverändert

                          root@IoBroker:~# ldd /opt/iobroker/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome | grep not                               
                                  libnss3.so => not found
                                  libnssutil3.so => not found
                                  libsmime3.so => not found
                                  libnspr4.so => not found
                                  libgbm.so.1 => not found
                          root@IoBroker:~#
                          
                          
                          
                          Thomas Braun 1 Reply Last reply Reply Quote 0
                          • Thomas Braun
                            Thomas Braun Most Active @crunchip last edited by Thomas Braun

                            @crunchip

                            Auch der root muss die libnss3 / libnspr4 / libgbm1 installiert haben.

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

                              @thomas-braun des sagst du 🙂 kann ja nix herbei zaubern, wo sollten die denn liegen?

                              root@IoBroker:~# ls -la /opt/iobroker/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/
                              insgesamt 364472
                              drwxrwxrwx+ 7 iobroker iobroker      4096  8. Jun 21:36 .
                              drwxrwxrwx+ 3 iobroker iobroker      4096  8. Jun 21:36 ..
                              -rwxr-xr-x+ 1 iobroker iobroker 325132000  8. Jun 21:36 chrome
                              -rw-r--r--+ 1 iobroker iobroker    634900  8. Jun 21:36 chrome_100_percent.pak
                              -rw-r--r--+ 1 iobroker iobroker    955808  8. Jun 21:36 chrome_200_percent.pak
                              -rwxr-xr-x+ 1 iobroker iobroker   1870168  8. Jun 21:36 chrome_crashpad_handler
                              -rwxr-xr-x+ 1 iobroker iobroker    349488  8. Jun 21:36 chrome_sandbox
                              -rwxr-xr-x+ 1 iobroker iobroker      5087  8. Jun 21:36 chrome-wrapper
                              drwxr-xr-x+ 3 iobroker iobroker      4096  8. Jun 21:36 ClearKeyCdm
                              -rw-r--r--+ 1 iobroker iobroker  10404784  8. Jun 21:36 icudtl.dat
                              -rwxr-xr-x+ 1 iobroker iobroker    406904  8. Jun 21:36 libEGL.so
                              -rwxr-xr-x+ 1 iobroker iobroker   9044984  8. Jun 21:36 libGLESv2.so
                              -rwxr-xr-x+ 1 iobroker iobroker   6194712  8. Jun 21:36 libvk_swiftshader.so
                              -rwxr-xr-x+ 1 iobroker iobroker    911200  8. Jun 21:36 libvulkan.so.1
                              drwxr-xr-x+ 2 iobroker iobroker      4096  8. Jun 21:36 locales
                              drwxrwxrwx+ 2 iobroker iobroker      4096  8. Jun 21:36 MEIPreload
                              -rwxr-xr-x+ 1 iobroker iobroker   4477352  8. Jun 21:36 nacl_helper
                              -rwxr-xr-x+ 1 iobroker iobroker      9880  8. Jun 21:36 nacl_helper_bootstrap
                              -rwxr-xr-x+ 1 iobroker iobroker   3933576  8. Jun 21:36 nacl_irt_x86_64.nexe
                              -rw-r--r--+ 1 iobroker iobroker      2531  8. Jun 21:36 product_logo_48.png
                              drwxr-xr-x+ 3 iobroker iobroker      4096  8. Jun 21:36 resources
                              -rw-r--r--+ 1 iobroker iobroker   7988530  8. Jun 21:36 resources.pak
                              drwxrwxrwx+ 2 iobroker iobroker      4096  8. Jun 21:36 swiftshader
                              -rw-r--r--+ 1 iobroker iobroker    731008  8. Jun 21:36 v8_context_snapshot.bin
                              -rw-r--r--+ 1 iobroker iobroker       107  8. Jun 21:36 vk_swiftshader_icd.json
                              -rwxr-xr-x+ 1 iobroker iobroker     37394  8. Jun 21:36 xdg-mime
                              -rwxr-xr-x+ 1 iobroker iobroker     33273  8. Jun 21:36 xdg-settings
                              
                              
                              Thomas Braun 1 Reply Last reply Reply Quote 0
                              • foxriver76
                                foxriver76 Developer last edited by

                                Zeig mal bitte Log vom Update auf 0.2.1

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

                                  @crunchip

                                  Ich weiß ja nicht ob die Intention von @foxriver76 ist die libs selber mitzubringen, aber die sind systemweit in den genannten Paketen drin.

                                  apt policy libnss3 libnspr4 libgbm1
                                  
                                  foxriver76 B 2 Replies Last reply Reply Quote 0
                                  • crunchip
                                    crunchip Forum Testing Most Active @foxriver76 last edited by crunchip

                                    @foxriver76 da gibt es nichts, weil der Host auf Logstufe "warn" steht

                                    nichts installiert

                                    root@IoBroker:~# apt policy libnss3 libnspr4 libgbm1
                                    libnss3:
                                      Installiert:           (keine)
                                      Installationskandidat: 2:3.61-1+deb11u2
                                      Versionstabelle:
                                         2:3.61-1+deb11u2 500
                                            500 http://deb.debian.org/debian bullseye/main amd64 Packages
                                            500 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages
                                    libnspr4:
                                      Installiert:           (keine)
                                      Installationskandidat: 2:4.29-1
                                      Versionstabelle:
                                         2:4.29-1 500
                                            500 http://deb.debian.org/debian bullseye/main amd64 Packages
                                    libgbm1:
                                      Installiert:           (keine)
                                      Installationskandidat: 20.3.5-1
                                      Versionstabelle:
                                         20.3.5-1 500
                                            500 http://deb.debian.org/debian bullseye/main amd64 Packages
                                    
                                    
                                    Thomas Braun 1 Reply Last reply Reply Quote 0
                                    • Thomas Braun
                                      Thomas Braun Most Active @crunchip last edited by

                                      @crunchip sagte in Puppeteer: Screenshots PhantomJS Alternative:

                                      nichts installiert

                                      Natürlich nicht. Sonst würden die ja auch gefunden werden. 🙂

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

                                        @thomas-braun aber ich bin doch jetzt nicht der einzige der diesen Adapter installiert hat und nur bei mir die Pakete fehlen

                                        so nebenbei, ich kann dich gar nicht "anschreiben", findet dich nicht, egal ob Groß oder Kleinschreibung, mit und ohne Bindestrich
                                        a15ed034-ce25-492c-a7fa-32978605f578-image.png

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

                                          @thomas-braun Ja das wäre die Intention, Controller sollte diese installieren bei >=0.2.1.

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

                                            @foxriver76 soll ich nochmal deinstallieren, Host umstellen und install Log posten?

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            818
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            browser headless phantomjs puppeteer screenshot screenshots website
                                            23
                                            245
                                            25541
                                            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