S
Sunny
Hi all,
I have to get a HTML content of a given URL, to inspect links and images and
to change something in there, and to save the result. I have done it already
with:
System.Net.WebClient source = new System.Net.WebClient();
StreamReader mr = null;
try
{
mr = new StreamReader(source.OpenRead(sUrl));
sWebPage = mr.ReadToEnd();
}
catch
{
oParent.PagesDone++;
return;
}
finally
{
if (mr != null)
mr.Close();
}
After that I make a lot of IndexOfs' and Replaces to change the things I
want, and as it is sooooo ugly
and slow.
So I decided to see if I can use MSHTML's IHTMLDocument2 interface, and just
to find and change values I need, but ... so far I couldn't imagine how to
place the string in the IHTMLDocument2 object and how to retrieve it from
there after that in order to save it.
Any clues will be highly appreciated.
Thanks
Sunny
I have to get a HTML content of a given URL, to inspect links and images and
to change something in there, and to save the result. I have done it already
with:
System.Net.WebClient source = new System.Net.WebClient();
StreamReader mr = null;
try
{
mr = new StreamReader(source.OpenRead(sUrl));
sWebPage = mr.ReadToEnd();
}
catch
{
oParent.PagesDone++;
return;
}
finally
{
if (mr != null)
mr.Close();
}
After that I make a lot of IndexOfs' and Replaces to change the things I
want, and as it is sooooo ugly
![Frown :( :(](/styles/default/custom/smilies/frown.gif)
So I decided to see if I can use MSHTML's IHTMLDocument2 interface, and just
to find and change values I need, but ... so far I couldn't imagine how to
place the string in the IHTMLDocument2 object and how to retrieve it from
there after that in order to save it.
Any clues will be highly appreciated.
Thanks
Sunny