Hi, I'm trying to write a script that visits webpages containing thumbnails linking to movies and fetches the thumbnail urls. Here is what I came up with:
$source =~ /href[^>]*\.$match[^>]*>[^<]*<[\s]*img[^>]*src[\s]*=["'\s]*([^"'\s>]*)/i;
$iurl = $1;
...where $match would be different movie extensions, like mpg/wmv/avi. This works well with the exception that if there are any html tags between the href and img tags, it won't match the image url. Basically, it always checks the html tag following the href tag and if it happens to be something different than an img tag, it won't work.
Does anyone have any idea how I could fix this? Any help would be greatly appreciated!
Thanks,
Tom
$source =~ /href[^>]*\.$match[^>]*>[^<]*<[\s]*img[^>]*src[\s]*=["'\s]*([^"'\s>]*)/i;
$iurl = $1;
...where $match would be different movie extensions, like mpg/wmv/avi. This works well with the exception that if there are any html tags between the href and img tags, it won't match the image url. Basically, it always checks the html tag following the href tag and if it happens to be something different than an img tag, it won't work.
Does anyone have any idea how I could fix this? Any help would be greatly appreciated!
Thanks,
Tom