无法将Google定义转换为标准输出

时间:2022-05-22 15:49:16

I aim to filter my Google results right at terminal such that I get only Google's definitions.

我的目标是在终端上过滤我的Google搜索结果,以便我只获得Google的定义。

I am trying to run the following in Mac's terminal

我试图在Mac的终端上运行以下内容

open http://www.google.com/search?q=define:cars&ie=utf-8&oe=utf-8:en-GB:official&client=vim

A similar command for Firefox is

Firefox的类似命令是

open http://www.google.com/search?q=define:cars&ie=utf-8&oe=utf-8:en-GB:official&client=firefox-a

Which client can you use to have Google's html page to your standard output?

您可以使用哪个客户端将Google的html页面添加到标准输出中?

2 个解决方案

#1


"GET"

GET 'http://www.google.com/search?q=define:cars&ie=utf-8&oe=utf-8:en-GB:official&client=vim'

See also "HEAD".

另见“HEAD”。

The command can be installable on Gnu/Linux OS:

该命令可以在Gnu / Linux操作系统上安装:

[elcuco@pinky ~]$ rpm -qf `which GET`
perl-libwww-perl-5.808-2mdv2008.1

In theory you could also use "wget" and output to stdout using something like this:

从理论上讲,您也可以使用“wget”并使用以下内容输出到stdout:

wget http://www.google.com -O - --quiet

However I cannot get it to work with this example URL.

但是我无法使用此示例URL。

#2


To use Google search not through their web interface, you're almost certainly better off using their API.

要使用谷歌搜索不是通过他们的网络界面,你几乎肯定更好地使用他们的API。

However, I think curl is the right tool to use to download a web page if that's what you have to do (and it probably isn't)

但是,我认为curl是用于下载网页的正确工具,如果这是你必须做的事情(它可能不是)

#1


"GET"

GET 'http://www.google.com/search?q=define:cars&ie=utf-8&oe=utf-8:en-GB:official&client=vim'

See also "HEAD".

另见“HEAD”。

The command can be installable on Gnu/Linux OS:

该命令可以在Gnu / Linux操作系统上安装:

[elcuco@pinky ~]$ rpm -qf `which GET`
perl-libwww-perl-5.808-2mdv2008.1

In theory you could also use "wget" and output to stdout using something like this:

从理论上讲,您也可以使用“wget”并使用以下内容输出到stdout:

wget http://www.google.com -O - --quiet

However I cannot get it to work with this example URL.

但是我无法使用此示例URL。

#2


To use Google search not through their web interface, you're almost certainly better off using their API.

要使用谷歌搜索不是通过他们的网络界面,你几乎肯定更好地使用他们的API。

However, I think curl is the right tool to use to download a web page if that's what you have to do (and it probably isn't)

但是,我认为curl是用于下载网页的正确工具,如果这是你必须做的事情(它可能不是)