簡體   English   中英

Javascript從html標記中選擇特定的數據

[英]Javascript select specificed data from html tag

javascript是否可以像PHP一樣使用關鍵字查找特定數據? 例如

other html from html page
<video> <source type="application/x-mpegurl" src="https://xxxx.xxxx/xxx.mp4"></video>
other html from html page

javascript如何工作2步驟1首先獲取html頁面(如php CURL)2找到特定的數據(在我的情況下,所有內容都在src =“ xx”中)(“ source type =” application / x-mpegurl“是查找的關鍵內容)?

抱歉,但是我在javascript中表現很差。

您可以使用javascript執行此操作:

document.querySelector('source[type="application/x-mpegurl"]').src

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM