views:

75

answers:

3

Hi,

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/20100125/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!

+5  A: 

Use BeautifulSoup or lxml.

Ignacio Vazquez-Abrams
+1 for BeautifulSoup
The MYYN
Thanks. The problem is that I cant get the video link. But if I push in play button in the web page, I can download the video file with the firefox extension "Download Helper" but I would like to do this automatically. Any help please?
mmm286
Then you've misrepresented the problem. If you need to decompile the SWF file then you'll have to look elsewhere.
Ignacio Vazquez-Abrams
the videos are generated by javascript. therefore, you can't really use HTML parser for that.
ghostdog74
A: 
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.

bluszcz
you can also use mentioned BeatifulSoup or mechanise.
bluszcz
Thanks. The problem is that I cant get the video link. But if I push in play button in the web page, I can download the video file with the firefox extension "Download Helper" but I would like to do this automatically. Any help please?
mmm286
A: 

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

ghostdog74
Many thanks, I try to find an alternative, but I don't find nothing. I have to to the video dowloads manually :-(Many thanks!
mmm286