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
5 Hours
Discussion Span
9 Months Ago
Last Updated
3
Views
Question Answered
Related Article:Parse an HTML doc
is a Python discussion thread by sarelnet that has 1 reply, was last updated 8 months ago and has been tagged with the keywords: parse, parsing, bs, beautifulsoup, tag, grep, regex.