用curl命令计数网站中的单词

发布于 2025-01-23 18:26:03 字数 319 浏览 2 评论 0原文

我在网站上很有趣,我需要计算一个单词在HTTPS网站的主页上出现多少次,并且我使用了几个卷曲和GREP命令,但结果并不确切: curl -silent https://xxxxxx.com | grep -c你好 curl -silent https://xxxxxx.com | grep -c -i -w你好

I'm having fun counting words in websites, I need to count how many times a word appeared on the main page of https website and and I use a couple of curl and grep commands but the results are not exact :
curl --silent https://xxxxxx.com | grep -c hello
curl --silent https://xxxxxx.com | grep -c -i -w hello

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

油饼 2025-01-30 18:26:03

我通过使用卷发找到了解决方案,它返回网站的全部内容,GREP仅hello hello and wc来计算出现的数量。

curl https://wwwwwwwwwww.com/ | grep -io你好| WC

如果您还有其他我感兴趣的想法,例如使用Python,Web刮擦,使用其他Linux命令,例如使用命令WGET而不是Curl。

祝你周末愉快

I found the solution by using curl it returns the whole content of the website, grep only the word hello and wc to calculate the number of occurrences.

curl https://wwwww.com/ | grep -io hello | wc

If you have other ideas I'm interested, like using python, Web scraping, using other linux commands like use command wget instead of curl.

Have a nice week end

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文