- Регистрация
- 03.02.2016
- Сообщения
- 88
- Благодарностей
- 6
- Баллы
- 8
Код:
SibboraHelper.WebHelper wHelper = new SibboraHelper.WebHelper();
Tab Tab1 = instance.ActiveTab;
int NumForClass = Convert.ToInt32(project.Variables["numOfClasses"].Value);
HtmlElement avaClosed = instance.ActiveTab.FindElementByXPath ("//span[@class='ic ic_closed']", 0);
Random rndPause = new Random();
int intRandomPause = rndPause.Next(1000, 5000);
for(int f=0;f<NumForClass;f++){
IZennoList lstClass = project.Lists["lstClasses"]; //
string strClass = lstClass[0];
Tab1.Navigate("https://ok.ru/profile/"+strClass);
Tab1.WaitDownloading();
System.Threading.Thread.Sleep(intRandomPause);
if (!avaClosed.IsVoid){
lstClass.RemoveAt(0);
}
else
{
instance.ActiveTab.FindElementByXPath("//img[@id='viewImageLinkId']", 0).Click();
System.Threading.Thread.Sleep(intRandomPause);
HtmlElement buttklass = instance.ActiveTab.FindElementByAttribute ("button","innertext","Like","regexp", 0);
buttklass.Click();
}
lstClass.RemoveAt(0);
}