开发者

Help parsing a page with python

开发者 https://www.devze.com 2022-12-18 01:26 出处:网络
I would like to parse a webpage to can get the url of the video download. I use python and firebug but I cant get the url link.

I would like to parse a webpage to can get the url of the video download. I use python and firebug but I cant get the url link.

Example:

The url where I have to get the video link is: hxxp://www.rtve.es/mediateca/videos/20100开发者_如何学Go125/saber-comer---salsa-verde-judiones-25-01-10/676590.shtml"

The video is hxxp://www.rtve.es/resources/TE_SSAC011/flv/8/2/1264426362028.flv Could you help me please? Many thanks and sorry for my english!


Use BeautifulSoup or lxml.


import re 
from urllib2 import urlopen
text = urlopen('http://www.rtve.es/mediateca/videos/20100125/saber-comer---salsa-verde-judiones-25-01-10/676590.shtm').read()
reg = re.compile(r'http://www\.rtv.*flv')
reg.findall(text)

Normallly you can use this one. But there is no your link inside.


@OP, those videos are generated by javascript. For this topic, see here. Or search google for references.

0

精彩评论

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

关注公众号