10

Is it possible to run any graphical browser (not lynx) from the console on CentOS 1708 without any installed GUI on it? I need to access the web interface of the device, but won't install a GUI on it.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255

5 Answers5

10

There are two common browsers that I've seen:

There are many less common ones, and as @gad3r pointed out some newer ones. Why not lynx? Do you have a special purpose in mind?

RubberStamp
  • 7,318
  • Special purpose - to get access on the web interface to login on device. I cant do it with lyns i dunno why. And also my boss says, there is a possibility to run normal browser (like chrome or firefox) without GUI and i says no, there is no way to do so without GUI. – Alexandr Anufriev Oct 28 '17 at 14:45
  • 2
    @AlexandrAnufriev: You probably need a javascript capable browser. Give links a try: links JS capable – RubberStamp Oct 28 '17 at 14:53
  • Do you need JS? you just need to fetch the static HTML content – Yousef Al-Hadhrami Oct 28 '17 at 15:35
  • And you can even strip the HTML tags just like it shows in this answer: https://unix.stackexchange.com/questions/42636/how-to-get-text-of-a-page-using-wget-without-html – Yousef Al-Hadhrami Oct 28 '17 at 15:38
  • It's your second best answer for me :D thank you so much. – Alexandr Anufriev Oct 28 '17 at 17:03
  • 1
    Also links2 and some versions of elinks have graphical and mouse support. You'll need gpm set up as well to use mouse. – ivanivan Oct 28 '17 at 17:09
  • @AlexandrAnufriev there are a lot of headless browsers that would work that are basically chrome and firefox. Chrome recently added a headless mode behind a flag, for example. – Seiyria Oct 28 '17 at 23:39
3

You can use googler:

Google Search, Google Site Search, Google News from the terminal

Installation :

git clone https://github.com/jarun/googler.git
cd googler
sudo make install

To use googler you need python3 , just install it and launch googler from python3 environment without changing the default python.

sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm
sudo yum -y install python36u

Update

ddgr tool is available here or here (rpm):

ddgr is a cmdline utility to search DuckDuckGo from the terminal.

git clone https://github.com/jarun/ddgr.git
cd ddgr/
sudo make install

see ddgr -h for help.

GAD3R
  • 66,769
3

Your question is like "How to fetch HTML web page content from bash and display on screen using shell utilities?"

Fedora / RHEL / CentOS Linux install curl, wget, lynx, and w3m

Open a terminal and and then type:

$ sudo yum install curl wget lynx w3m

wget -O - https://unix.stackexchange.com/questions/401068/web-browser-from-console-centos

To read the full article Bash: Display Web Page Content In Terminal

  • Thank you for reply, but not exactly. What are you talking about - was my target. But lately it transformed in some kind of principal question and to show my boss that he is wrong. He told me, its possible to run graphical browser (like firefox or chrome) from shell without GUI, like 'yum install firefox' and then just root@localhost$ firefox, and it should open a window of firefox. Ive told him no way without GUI. So it was my general question here - is it possible or not without gui. I know about links, but that was not what i'm questioning about. Thank you. – Alexandr Anufriev Oct 28 '17 at 17:03
  • Oh I see, and I'm happy to help. BTW, so your question is something like this? https://unix.stackexchange.com/questions/9107/how-can-i-run-firefox-on-linux-headlessly-i-e-without-requiring-libgtk-x11-2-0 which is impossible? – Yousef Al-Hadhrami Oct 28 '17 at 17:16
  • Yes, my question was the same. – Alexandr Anufriev Oct 28 '17 at 17:32
2

You said in a comment:

And also my boss says, there is a possibility to run normal browser (like chrome or firefox) without GUI and i says no, there is no way to do so without GUI.

That isn’t true. Both Chrome and Firefox support headless modes. Similar to PhantomJS, their use is more geared towards tooling and testing, but that may fit your use case. See:

Chrome Headless

zero298
  • 129
  • He was talking about firefox or chrome, or similar. He said, that its enough to "yum install firefox" and then "local$ firefox" to start it. Without any additional configurations or expansions, or how is it called properly in linux. Thank you for your answer! So he thought it should works like: 1. Loggoing on server via putty ssh, installing chrome, running chrome. I said - no way. He didn't know abouy any headless mode, or even lynx. He used firefox before on this server, but in the past there was installed gnome! So i told him about that. – Alexandr Anufriev Oct 29 '17 at 09:22
  • And btw, i dont need headless solution. What i was looking for was described before. Simple question - can be chrome of firefox or similar work only with "yum install..." without expansions like Xs, GUI. – Alexandr Anufriev Oct 29 '17 at 12:01
2

netsurf has a graphical framebuffer mode that can be run on a tty. This needs to be specially compiled and it requires framebuffer support.

When it is working, you can use most graphical pages from your tty, the same way as you would use netsurf under X11 or similar.

anna328p
  • 267