This is a quick and ugly way to do it without any library:
"""
>>> get_src(data)
['http://www.askgamblers.com/cache/97299a130feb2e59a08a08817daf2c0e6825991f_begado-casino-logo-review1.jpg', 'http://feeds.feedburner.com/~r/AskgamblesCasinoNews/~4/SXhvCskjiYo']
"""
data = """<img src="http://www.askgamblers.com/cache/97299a130feb2e59a08a08817daf2c0e6825991f_begado-casino-logo-review1.jpg" /><br/>
Begado is the newest online casino in our listings. As the newest
member of the Affactive group, Begado features NuWorks slots and games
for both US and international players.
<img src="http://feeds.feedburner.com/~r/AskgamblesCasinoNews/~4/SXhvCskjiYo" height="1" width="1"/>"""
def get_src(lines):
srcs = []
for line in data.splitlines():
i = line.find('src=') + 5
f = line.find('"', i)
if i > 0 and f > 0:
srcs.append(line[i:f])
return srcs
However I would recomend using Beatiful Soup, its a really nice library designed to deal with the real
web (broken HTML and all) or you could use Element Tree from Python standard library if your data is valid XML.