开发者

Help parsing a page with python

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜