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]:
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.
9 Months Ago
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.