# Screenshot from a homepage

**URL:** <https://discourse.nodered.org/t/screenshot-from-a-homepage/48996>\
**Category:** General\
**Created:** [28 July 2021 06:19 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996 "2021-07-28T06:19:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [28 July 2021 06:19 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/1 "2021-07-28T06:19:21Z")

</div>

Hello!

Is it possible to take a screenshot from a homepage? I have a list of homepages and want to take a screenshot of each one and the picture should then be saved.

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [28 July 2021 19:07 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/2 "2021-07-28T19:07:30Z")

</div>

Hello!

Doesn't anyone have any idea how to do that? You can also save as a PDF if it is not possible as an image.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [28 July 2021 19:13 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/3 "2021-07-28T19:13:09Z")

</div>

Have you been through [these](https://discourse.nodered.org/search?q=screenshot%20web)?

Part of the difficulty is the web page runs outside node-red (on the client/viewers browser) and to get a picture saved back to your node-red server is like letting google or your employer or you ISP take screenshots of what you are browsing - its fraught with danger! Similar to asking a browser to screenshot to file on the client PC is just as dangerous (you can imagine the amount of malware that would be dumped all over your PC by bad actors if that was permitted?)

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [28 July 2021 19:20 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/4 "2021-07-28T19:20:40Z")

</div>

Hello!

Thanks for the reply.

No, I am in Europe and it is just 9 p.m.

OK but to read a page as text?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [28 July 2021 19:23 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/5 "2021-07-28T19:23:55Z")

</div>

> [@madmax](#):
>
> OK but to read a page as text?

Getting text is (often) easier. Since a browser simply does a HTTP Request to the web server (and gets back the HTML + text etc) you can do the same thing with a HTTP Request node in node-red. However, extracting the correct elements from the response can be tricky.

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [28 July 2021 19:25 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/6 "2021-07-28T19:25:33Z")

</div>

> [@Steve-Mcl](#):
>
> Getting text is (often) easier. Since a browser simply does a HTTP Request to the web server (and gets back the HTML + text etc) you can do the same thing with a HTTP Request node in node-red. However, extracting the correct elements from the response can be tricky.

OK Thanks

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [28 July 2021 19:27 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/7 "2021-07-28T19:27:45Z")

</div>

> [@Steve-Mcl](#):
>
> Getting text is (often) easier. Since a browser simply does a HTTP Request to the web server (and gets back the HTML + text etc) you can do the same thing with a HTTP Request node in node-red. However, extracting the correct elements from the response can be tricky.

I completely forgot, did you have an example?

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [28 July 2021 19:35 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/8 "2021-07-28T19:35:09Z")

</div>

In the nodered cookbook: [Simple GET request : Node-RED](https://cookbook.nodered.org/http/simple-get-request)

This one should be of help to you.

---

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [28 July 2021 19:55 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/9 "2021-07-28T19:55:58Z")

</div>

In case you're still interested in screenshots. I quickly tested `node-red-contrib-web-page-screenshot` and it seems to work. Tested on an ubuntu machine.

- had to install `chromium-browser` package
- the path to the browser for rendering has to be correct (in my case `/usr/bin/chromium-browser`)
- the list with the websites is in the first function node
- the rendering is quite slow (and the screenshot files are large), maybe there are some more options you can play with and make it faster

```auto
[{"id":"2fe6f48.ec2f80c","type":"screenshot","z":"67c61941.053d58","name":"","url":"","path":"/usr/bin/chromium-browser","x":930,"y":160,"wires":[["a37e9457fc9c21a8","479a8cfe337a4e9f"]]},{"id":"479a8cfe337a4e9f","type":"file","z":"67c61941.053d58","name":"","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"base64","x":1150,"y":160,"wires":[[]]},{"id":"a37e9457fc9c21a8","type":"debug","z":"67c61941.053d58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1150,"y":100,"wires":[]},{"id":"682d9d29fd22a728","type":"inject","z":"67c61941.053d58","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":140,"y":160,"wires":[["8f8fb39a9fdeed89"]]},{"id":"8f8fb39a9fdeed89","type":"function","z":"67c61941.053d58","name":"","func":"msg.payload = [\"https://nodered.org/\",\"https://github.com/\"];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":160,"wires":[["d21886a98d98f109"]]},{"id":"d21886a98d98f109","type":"split","z":"67c61941.053d58","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":430,"y":160,"wires":[["8eb67b2be99072f8"]]},{"id":"8eb67b2be99072f8","type":"change","z":"67c61941.053d58","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":160,"wires":[["a0681d10f35e142a"]]},{"id":"a0681d10f35e142a","type":"function","z":"67c61941.053d58","name":"","func":"//dirty: assuming urls start with http(s):// \nmsg.filename = msg.url.split(\"://\")[1].replace(\"/\",\"\")+\".png\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":160,"wires":[["2fe6f48.ec2f80c"]]}]

```

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [29 July 2021 11:04 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/10 "2021-07-29T11:04:37Z")

</div>

> [@rko](#):
>
> In case you're still interested in screenshots. I quickly tested `node-red-contrib-web-page-screenshot` and it seems to work. Tested on an ubuntu machine.
> 
> - had to install `chromium-browser` package
> - the path to the browser for rendering has to be correct (in my case `/usr/bin/chromium-browser` )
> - the list with the websites is in the first function node
> - the rendering is quite slow (and the screenshot files are large), maybe there are some more options you can play with and make it faster
> 
> ```auto
> [{"id":"2fe6f48.ec2f80c","type":"screenshot","z":"67c61941.053d58","name":"","
> 
> ```

Hello!

Thanks for that. Goes very well. Unfortunately I have the problem that my dashboard no longer works. I get felicitous errors

"RequestError: connect ECONNREFUSED 127.0.0.1:443"

What could that be?

---

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [29 July 2021 11:32 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/11 "2021-07-29T11:32:44Z")

</div>

Hi @madmax, I am really not sure. Can you provide some more details about your system and when exactly the error occurs?

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [29 July 2021 11:36 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/12 "2021-07-29T11:36:57Z")

</div>

I have a dashboard where a file is downloaded via the push of a button and is displayed in a table.

When I set up the flow and created the screenshot but unfortunately nothing happens in the dashboard. The file will no longer be downloaded.

The Node Red runs on a MAC.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [29 July 2021 11:45 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/13 "2021-07-29T11:45:35Z")

</div>

What happens if you disable the flow taking the screen shot?

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [29 July 2021 11:48 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/14 "2021-07-29T11:48:27Z")

</div>

it doesn't work there either, but when I restart node red it works again.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [29 July 2021 13:11 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/15 "2021-07-29T13:11:32Z")

</div>

1. what version of NR and node.js? (See startup log)
2. please export your flow and add it to a reply
3. what device is NR running on?

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [29 July 2021 13:20 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/16 "2021-07-29T13:20:40Z")

</div>

Hello!

I am using the 2.0.1 version.

```auto
[{"id":"7ad821b5.a71f7","type":"http request","z":"c07eb5bb.98b6","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.michaelklausner.eu/index.php?module=report&action=export&id=85&cmd=82b38e3c31c7dfe72e55dbb6cebdf143cb5dd31da5b8d7a48e63db8b109182030920e2d068ab2b7d35290bb6a8a78a2f25282b8676f5a7f4c5d55805b810c95b57330796d77bde49765f905c05292bc46484a856273007e27fb7227f784a6cc2ce3feb4ac4b7afebe17704b8fa99ee4f61fca18dee4d930e1a8edf60f6bf8c2a","tls":"","persist":false,"proxy":"","authType":"","credentials":{},"x":290,"y":140,"wires":[["669889b7.0ceb18"]]}]

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [29 July 2021 17:08 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/17 "2021-07-29T17:08:48Z")

</div>

And on what device? (Please answer `all` questions someone - who is trying to help you asks. It saves their time and you could get a quicker answer)

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [29 July 2021 17:36 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/18 "2021-07-29T17:36:33Z")

</div>

Hello!

iMac 24 M1

---

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [29 July 2021 18:12 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/19 "2021-07-29T18:12:10Z")

</div>

Also the flow does not seem to be complete. Can you check again? It contains only one node.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 September 2021 18:12 UTC](https://discourse.nodered.org/t/screenshot-from-a-homepage/48996/20 "2021-09-27T18:12:26Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
