用bash抓取网页

编程入门 行业动态 更新时间:2024-10-28 03:25:34
本文介绍了用bash抓取网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用bash www.mcdelivery. com.pk/pk/browse/menu.html 并过滤左侧菜单以显示交易名称和价格.我需要帮助,请让我知道如何编写bash脚本以获取交易的名称和价格.预先感谢

I am trying to webscrape with bash www.mcdelivery.pk/pk/browse/menu.html and filter the menu on the left to display the deal name and price. I need help please let me know how to write a bash script to get the name and price of the deals. Thanks in advance

推荐答案

使用sed grep html文件中的名称和价格.每个交易名称都包含在类product-title的h5元素中,每个价格都包含在类starting-price的span元素中.仔细阅读有关此答案的一些示例[1],这应该可以帮助您前进.

Use sed to grep the html file for the names and prices. Every deal name is enclosed in an h5 element with class product-title, and every price is enclosed in a span element with class starting-price. Look through some examples on this answer [1], and that should get you going.

[1] 提取部分代码并在bash中解析HTML

更多推荐

用bash抓取网页

本文发布于:2023-06-08 11:11:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/608256.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网页   bash

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!