by Devin Yang
(This article was automatically translated.)

Published - 7 years ago ( Updated - 7 years ago )

The video below the article introduces how to use rendertron to solve Polymer SEO optimization problems.
In the source of my fork, it has been adjusted to support the Chinese environment.
And also added the API interface of pdf, which can also be used to convert pdf.

Original Rendertron GitHub link
https://github.com/GoogleChrome/rendertron

The source of my fork has adjusted the Chinese environment, you can refer to the settings on my GitHub.
In addition, I also adjusted the source and added the pdf API, so if I use my source to build image, there will be an extra pdf button.
https://github.com/DevinY/rendertron
 

Error about 'ECONNREFUSED':

When your kernel lacks user namespace support or when you try to access a service in a container, you will encounter an ECONNREFUSED error,
Here are two recommended ways to resolve this issue:
  1. [Recommended] - Use Jessie Frazelle' seccomp profile with the -security-opt flag
  2. Use the --cap-add SYS_ADMIN flag
1. Download the seccomp configuration file (chrome.json) of Jessie Frazelle's Chrome browser via wget to start the container with the built-in image:
wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json
docker run -it -p 8080:8080 --security-opt seccomp=$HOME/chrome.json --name rendertron-container rendertron

2. The container of the image file created and executed using SYS_ADMIN:
docker run -it -p 8080:8080 --cap-add SYS_ADMIN --name rendertron-container rendertron

About Chinese Support

You may have noticed that the image built in the original docker environment is in English.
Therefore, it is also in English when capturing pictures through the API (test URL):
https://render-tron.appspot.com/screenshot/https://www.google.com

If you don't want to build the image yourself
You can directly use the image I built first,
The execution method is as follows:
1. First download chrome.json to the home directory of your host ( you only need to do it once, if you use a Mac system without wget installed, please use other methods to download the json file ):
wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json

2. Create a container. Here I added the --rm parameter. When stopping, I want to remove the container. Try the function of capturing pictures, and it will be in Chinese.
docker run --rm -it -p 8080:8080 --security-opt seccomp=$HOME/chrome.json --name rendertron-container deviny/rendertron

Note:
If you use npm install to install and use npm start to execute,
If your system environment is Chinese, Chinese can be displayed.
npm start
> bot-render@1.0.0 start /Users/devin/rendertron
> node src/main.js
Chrome launched with debugging on port 54791
Listening on port 3000


For a detailed introduction on how rendertron is actually used, please see the video below:

Tags: docker polymer seo

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


docker

Install Docker and docker-compose with Raspberry Pi

This article briefly introduces how we install docker and docker-compose on Raspberry Pi.

docker,cli

Docker container formatted display

I think if you want to write some automation functions, it may be useful to be able to format the output container content. The following are some reference examples of Docker container formatting and display instructions

certbot,docker,ftp

curlftpfs introduction and manual certificate application

Situation sharing, imagine that you have WebHosting, which only provides FTP connection, and then you want to apply for a certificate manually. In this article, I share how I use Docker to install curlftpfs, mount the FTP folder of the remote host, and then execute certbot in the container to apply for an SSL certificate. Leaving aside the certificate application, when I first discovered the curlftpfs command, I found it very interesting, especially if you are a MacOS user and do not have a satisfactory FTP software at hand. You love scrolling through the command line as much as I do, so maybe you should love this command too. 🤭