开发者

How to get the links from all the embedded videos on a webpage?

开发者 https://www.devze.com 2023-02-06 23:51 出处:网络
Let me explain. What I\'m trying to do is, given a certain webpage I want to get the count of how many embedded videos and their links.

Let me explain. What I'm trying to do is, given a certain webpage I want to get the count of how many embedded videos and their links.

I'm not asking for the code 开发者_如何学JAVAitself, but some pieces of information on how to achieve that.


Embedded videos will be using <object> and <embed> tags. Pattern looks something like this:

<object width="550" height="400">
  <param name="movie" value="somefilename.swf">
  <embed src="somefilename.swf" width="550" height="400">
  </embed>
</object>

So if you use jquery, you could look for all elements of type object, and then get their param named "movie"'s value attribute. Or you could look for embed tags and their src attribute, either way.

0

精彩评论

暂无评论...
验证码 换一张
取 消