Hi Kaka,
Using WebRequest to get the html page source and then parsing the source for specific terms you should be able to find the urls of swfs. Take a look at the code sample below:
using
System;
using
System.Net;
using
System.IO;
namespace
ParseHtmlSource
{
class Program
{
static void Main(string[] args)
{
string url = "http://www.adobe.com/";
HttpWebRequest myWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
myWebRequest.Method =
"GET";
// request to url
HttpWebResponse myWebResponse = (HttpWebResponse)myWebRequest.GetResponse();
StreamReader myWebSource = new StreamReader(myWebResponse.GetResponseStream());
string htmlSource = myWebSource.ReadToEnd();
int swfIndex = 0;
//parse html source for .swf
while (swfIndex != htmlSource.Length &&
-1 != (swfIndex = htmlSource.IndexOf(
".swf\"",swfIndex+1)))
{
int beginIndex = htmlSource.LastIndexOf('"', swfIndex);;
int endIndex = htmlSource.IndexOf('"', swfIndex);
Console.WriteLine(htmlSource.Substring(beginIndex,endIndex-beginIndex+1));
}
swfIndex = 0;
while (swfIndex != htmlSource.Length &&
-1 != (swfIndex = htmlSource.IndexOf(
".swf'", swfIndex + 1)))
{
int endIndex = htmlSource.IndexOf("'", swfIndex);
int beginIndex = htmlSource.LastIndexOf("'", swfIndex);
Console.WriteLine(htmlSource.Substring(beginIndex, endIndex - beginIndex + 1));
}
myWebResponse.Close();
}
}
}