0

I'm trying to write a script that will search a page for mp3 files, and download the first one. All is fine, but when I'm finding the links the first two are not mp3 files. At the moment I'm doing:

for link in page.findAll('a')[:3]:
   f.write(link.get('href'))

This finds the first 3 results, the third of which is the first mp3 file on the page. My question is, instead of finding the first three links, how can i find JUST the third? I need to do this so I can write it to a file and let my downloader pick it up.

Thanks in advance, Tom.

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by satnav_8
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.