godless
How to use C# to determine the end or next redirection point of a page
while (sheet.Cell(i, 0).ToString() != "")
{
string t = sheet.Cell(i, 0).ToString();
try
{
HTML = await client.GetStringAsync(sheet.Cell(i, 0).ToString());
}
catch (HttpRequestException e)
{
i++;
continue;
}
finally
{
if (HTML != null)
{
if (HTML.Contains("googletagmanager.com") || HTML.Contains("google-analytics.com"))
{
sheet.Cell(i, Write - 1).Value = "1";
}
else
{
sheet.Cell(i, Write - 1).Value = "0";
}
}
//here i nedd to save end URL after redirectings (if there was redirectings)
i++;
}
}
44 replies