Esempio n. 1
0
        public void LowBloodPressureTextValidation()
        {
            using (IWebDriver driver = new PhantomJSDriver())
            {
                driver.Navigate().GoToUrl(webAppUri);


                IWebElement systolicElement = driver.FindElement(By.Id("BP_Systolic"));

                clearTextBox(systolicElement);
                systolicElement.SendKeys("70");
                systolicElement.SendKeys(Keys.Tab);

                IWebElement diastolicElement = driver.FindElement(By.Id("BP_Diastolic"));

                clearTextBox(diastolicElement);
                diastolicElement.SendKeys("52");
                diastolicElement.SendKeys(Keys.Tab);

                IWebElement bodyText = driver.FindElement(By.TagName("body"));
                System.Diagnostics.Debug.WriteLine(bodyText.Text);
                StringAssert.Contains(bodyText.Text, "Low Blood Pressure");

                driver.Quit();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Starting point for the application.
        /// </summary>
        /// <param name="args"> The arguments passed in from the console. </param>
        public static void Main(string[] args)
        {
            PhantomJSDriverService service = PhantomJSDriverService.CreateDefaultService();

            service.IgnoreSslErrors = true;
            service.LoadImages      = false;

            Console.WriteLine("gebruikersnaam");
            string gebruikersnaam = Console.ReadLine();

            Console.WriteLine("wachtwoord");
            string wachtwoord = Console.ReadLine();

            IWebDriver driver = new PhantomJSDriver(service);

            driver.Navigate().GoToUrl("https://mijn.ing.nl/internetbankieren/SesamLoginServlet");

            IWebElement gebruikersnaamElem = driver.FindElement(By.XPath("//div[@id='gebruikersnaam']/descendant::input"));

            gebruikersnaamElem.SendKeys(gebruikersnaam);
            IWebElement wachtwoordElem = driver.FindElement(By.XPath("//div[@id='wachtwoord']/descendant::input"));

            wachtwoordElem.SendKeys(wachtwoord);
            IWebElement button = driver.FindElement(By.CssSelector("button.submit"));

            button.Click();

            ((ITakesScreenshot)driver).GetScreenshot().SaveAsFile("ing.png", ImageFormat.Png);
            System.IO.File.WriteAllText("ing.html", driver.PageSource);

            driver.Quit();

            Console.WriteLine("We are done");
            Console.ReadKey();
        }
Esempio n. 3
0
        static public void getItems(ref TimeStamp cTimestep)
        {
            var service = PhantomJSDriverService.CreateDefaultService();
            var phantomJSDriverService = PhantomJSDriverService.CreateDefaultService(@"C:\phantomjs-2.1.1-windows\bin");

            using (PhantomJSDriver driver = new PhantomJSDriver(phantomJSDriverService))
            {
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
                driver.Url = @"http://www.finanzen.net/anleihen/" + cTimestep.link;
                driver.Navigate();
                //Console.WriteLine(driver.PageSource);
                try
                {
                    IWebElement element = driver.FindElement(By.ClassName("col-xs-5"));
                    cTimestep.lastprice = Convert.ToDouble(element.Text.Replace(",", ".").Replace("-", "0").Replace("%", null).Replace("±", null));
                    element             = driver.FindElement(By.ClassName("col-xs-4"));
                    cTimestep.change    = Convert.ToDouble(element.Text.Replace(",", String.Empty).Replace("-", "0").Replace("+", null).Replace("±", null));
                    element             = driver.FindElement(By.ClassName("col-xs-3"));
                    cTimestep.pctChange = Convert.ToDouble(element.Text.Replace(",", ".").Replace("-", "0").Replace("%", null).Replace("+", null).Replace("±", null));
                    cTimestep.high      = cTimestep.lastprice;
                    cTimestep.low       = cTimestep.lastprice;
                    cTimestep.timestamp = DateTime.Now;
                }
                catch (Exception e)
                {
                    throw new Exception("Problem getting the input" + e + " \n WITH" + cTimestep.id);
                }
            }
        }
Esempio n. 4
0
 protected void Click(string path, string pathType)
 {
     if (pathType == "id")
     {
         IWebElement element = driver.FindElement(By.Id(path));
         element.Click();
         TestCase.Log("Clicked element with id=" + path);
     }
     else if (pathType == "name")
     {
         IWebElement element = driver.FindElement(By.Name(path));
         element.Click();
         TestCase.Log("Clicked element with name=" + path);
     }
     else if (pathType == "class")
     {
         IWebElement element = driver.FindElement(By.ClassName(path));
         element.Click();
         TestCase.Log("Clicked element with class=" + path);
     }
     else if (pathType == "xpath")
     {
         IWebElement element = driver.FindElement(By.XPath(path));
         element.Click();
         TestCase.Log("Clicked element with xpath=" + path);
     }
 }
Esempio n. 5
0
        public void HighBloodPressureImageValidation()
        {
            using (IWebDriver driver = new PhantomJSDriver())
            {
                driver.Navigate().GoToUrl(webAppUri);

                System.Diagnostics.Debug.WriteLine(driver.PageSource);


                IWebElement diastolicElement = driver.FindElement(By.Id("BP_Diastolic"));

                clearTextBox(diastolicElement);
                diastolicElement.SendKeys("90");
                diastolicElement.SendKeys(Keys.Tab);

                IWebElement bodyText = driver.FindElement(By.TagName("body"));
                System.Diagnostics.Debug.WriteLine(bodyText.Text);

                WebDriverWait wait      = new WebDriverWait(driver, TimeSpan.FromSeconds(3));
                IWebElement   ambulance = driver.FindElement(By.Id("ambulanceImage"));

                Assert.IsNotNull(ambulance);

                driver.Quit();
            }
        }
Esempio n. 6
0
        public bool ConnectionTest(string login, string password)
        {
            var service = PhantomJSDriverService.CreateDefaultService();

            service.IgnoreSslErrors = true;
            service.LoadImages      = false;
            service.ProxyType       = "none";
            service.SslProtocol     = "any";

            var options = new PhantomJSOptions();

            options.AddAdditionalCapability("phantomjs.page.settings.userAgent", _phantomJsUserAgent);

            var phantomCheckConnection = new PhantomJSDriver(service, options);

            phantomCheckConnection.Navigate().GoToUrl($"{BaseUrl}/accounts/login");

            phantomCheckConnection.FindElement(By.Id("input_login_email")).SendKeys(login);
            phantomCheckConnection.FindElement(By.Id("input_login_password")).SendKeys(password);
            phantomCheckConnection.FindElement(By.Id("signin_submit")).Click();

            Func <IWebDriver, bool> del = ExpectedConditions.UrlContains($"{BaseUrl}/app/");
            var result = del.Invoke(phantomCheckConnection);

            phantomCheckConnection.Quit();
            return(result);
        }
        static void Main(string[] args)
        {
            var url     = "https://passport.cnblogs.com/user/signin";
            var driver1 = new PhantomJSDriver(GetPhantomJSDriverService());

            driver1.Navigate().GoToUrl(url);

            if (driver1.Title == "用户登录 - 博客园")
            {
                driver1.FindElement(By.Id("input1")).SendKeys("xielongbao");
                driver1.FindElement(By.Id("input2")).SendKeys("1234");
                driver1.FindElement(By.Id("signin")).Click();
            }
            driver1.GetScreenshot().SaveAsFile(@"C:\aa.png", ScreenshotImageFormat.Png);
            var o = driver1.ExecuteScript("$('#signin').val('dsa')");

            Console.WriteLine(driver1.PageSource);
            driver1.Navigate().GoToUrl(url);
            Console.WriteLine(driver1.PageSource);
            IWebDriver driver2 = new PhantomJSDriver(GetPhantomJSDriverService());

            driver2.Navigate().GoToUrl("https://home.cnblogs.com/");

            Console.WriteLine(driver2.PageSource);
            Console.WriteLine(driver1.PageSource);

            Console.Read();
        }
        /// <summary>
        /// 解析文件所含的全部资源
        /// </summary>
        /// <param name="url"></param>
        public string SaveFromExtraFile(string url, Guid taskId)
        {
            using (var driver = new PhantomJSDriver(GetPhantomJSDriverService()))
            {
                $"正在加载地址:{url}...".Log(true);
                driver.Navigate().GoToUrl(url);
                //最大化窗口
                MaxBrowser(driver);
                "正在调整浏览器窗体大小...".Log(true);
                //第1次加载更多
                //用户的分享超过一屏时
                IWebElement moreShare = null;
                try
                {
                    moreShare = driver.FindElement(By.LinkText("更多"));
                }
                catch
                {
                    "该用户可分享的内容少于一屏,跳过流程解析...".Log(true);
                }
                if (moreShare != null)
                {
                    "正在点击页面的“更多”按钮...".Log(true);
                    driver.FindElement(By.LinkText("更多")).Click();
                    System.Threading.Thread.Sleep(2000);
                    "正在加载第二页内容...".Log(true);
                    "第二页内容加载完成...".Log(true);
                    //获取需要滚动加载的次数
                    "正在计算全部需要加载的页数...".Log(true);
                    var cardCount   = int.Parse(driver.FindElements(By.CssSelector("._fd86t")).First().Text.Replace(",", ""));
                    var scrollCount = cardCount / 12 == 0 ? cardCount / 12 : (cardCount / 12) + 1;
                    $"计算完成,全部需要加载{scrollCount}页...".Log(true);
                    //默认滚动条移动到y轴3000的位置
                    var initialC = 3000;
                    var i        = 0;
                    "开始执行脚本,滚动鼠标...".Log(true);
                    do
                    {
                        //if (i > 20)//预设只滚动20次,太多次容易卡顿
                        //    break;
                        $"第{i + 1}次滚动...".Log(true);
                        ((IJavaScriptExecutor)driver).ExecuteScript($"scrollTo(0,{initialC});");
                        System.Threading.Thread.Sleep(1000 + (i * 50));
                        i++;
                        initialC += 500;//每次递增滚动500的距离
                    } while (i < scrollCount);
                }
                "页面所有内容全部加载完成...".Log(true);

                var insDir = url.Substring(url.LastIndexOf('/') + 1);

                "正在解析下载的资源...".Log(true);
                ExtraDownloadSource(driver.PageSource, taskId);
                driver.Quit();
                return(insDir);
            }
        }
Esempio n. 9
0
 public IWebElement FindElementWithChecking(By by)
 {
     if (!Canceled)
     {
         return(_driver.FindElement(@by));
     }
     _logger.Info(
         "Interrupted by Canceled flag. throw new WebDriverException");
     throw new WebDriverException();
 }
Esempio n. 10
0
        void crawl(string number)
        {
            var driverService = PhantomJSDriverService.CreateDefaultService(Environment.CurrentDirectory);


            driverService.HideCommandPromptWindow = true;

            IWebDriver driver = new PhantomJSDriver(driverService);

            driver.Navigate().GoToUrl("https://www.truecaller.com/");

            try
            {
                //       ((ITakesScreenshot)driver).GetScreenshot().SaveAsFile(@"E:\Haider\Haider\Beautiful Soup\img1.jpg", ScreenshotImageFormat.Jpeg);
                var set = driver.FindElement(By.ClassName("searchbar__query"));
                set.SendKeys("+" + number);
                var    button = driver.FindElement(By.ClassName("searchbar__submit"));
                string js     = "arguments[0].click();";

                ((IJavaScriptExecutor)driver).ExecuteScript(js, button);

                Thread.Sleep(10);


                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

                string name          = "";
                string other_details = "";
                Loboloba.Text = "";
                foreach (var element in driver.FindElements(By.CssSelector("div.profile-name")))
                {
                    Loboloba.Text += name = element.Text + Environment.NewLine;
                }
                foreach (var element in driver.FindElements(By.CssSelector("div.profile-details-text")))
                {
                    Loboloba.Text += other_details = element.Text + Environment.NewLine;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            finally
            {
                driver.Close();
                driver.Quit();
            }
        }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //var webClient = new WebClient();
            //var form = new BasicHtmlForm(webClient);
            //form.Load(new Uri("http://www.weather.gov/"), new KeyValuePair<string, string>("name", "getForecast"));
            //form.InputControls.Single(c => c.Name == "inputstring").Value = "fairbanks, ak";

            //using (var response = form.Submit())
            //{
            //    if (response.ResponseType == WebResponseType.Html)
            //    {
            //        var scraper = new TestScraper(((HtmlWebResponse)response).Html);

            //        var conditions = scraper.GetConditions();

            //        var temperature = scraper.GetTemperature();
            //        System.Diagnostics.Debug.WriteLine(conditions);
            //        Weather.InnerText = temperature;

            //        var scraper2 = new TestScraper2(((HtmlWebResponse)response).Html);
            //        var craigslist = scraper2.GetList();
            //    }
            //}

            var webClient1 = new WebClient();
            var form1      = new BasicHtmlForm(webClient1);

            form1.Load(new Uri("https://www.trulia.com/rent/"), new KeyValuePair <string, string>("data-reactid", "29"));
            form1.InputControls.Single(c => c.Name == "location-autocomplete").Value = "Frisco, TX";
            using (var response = form1.Submit())
            {
                if (response.ResponseType == WebResponseType.Html)
                {
                    var scraper2 = new TestScraper2(((HtmlWebResponse)response).Html);

                    // var craigslist = scraper2.GetList();
                    // Weather.InnerText = craigslist;
                }
            }


            IWebDriver driver = new PhantomJSDriver();

            driver.Navigate().GoToUrl("https://twitter.com/Twitter");
            var backpack  = driver.Title;
            var back      = driver.FindElement(By.XPath("//*[@class='u-linkComplex-target']"));
            var backpack2 = driver.FindElement(By.XPath("//*[contains(@class,'twitter-timeline-link')]/span[2]"));
        }
Esempio n. 12
0
        void sign_out()
        {
            var driverService = PhantomJSDriverService.CreateDefaultService(Environment.CurrentDirectory);

            driverService.HideCommandPromptWindow = true;
            IWebDriver driver = new PhantomJSDriver(driverService);

            driver.Navigate().GoToUrl("https://www.truecaller.com/");
            try
            {
                var    div = driver.FindElement(By.TagName("div")).FindElement(By.XPath("//*[contains(text(), 'Sign out')]"));
                string js  = "arguments[0].click();";

                ((IJavaScriptExecutor)driver).ExecuteScript(js, div);

                Thread.Sleep(10);


                MessageBox.Show("Signed Out Successfully");
                lbl_Check.Text       = "Signed Out";
                btn_Sign_IN.Enabled  = true;
                btn_Sign_OUT.Enabled = false;
            }
            catch (Exception e)
            {
                MessageBox.Show("You Need to Signed in, In order to get Signed Out");
                MessageBox.Show(e.Message);
            }
            finally
            {
                driver.Close();
                driver.Quit();
            }
        }
Esempio n. 13
0
        public static Dictionary <string, double> ExecuteAndRead(string html, IEnumerable <string> elementNames)
        {
            var path = Path.Combine(Default.RangerFolder, fileName);

            // ToDo: Find a way to do this without writing to a file.
            File.WriteAllText(path, html);

            var service = PhantomJSDriverService.CreateDefaultService(Default.RangerFolder);

            service.HideCommandPromptWindow = true;

            var driver   = new PhantomJSDriver(service);
            var filePath = Path.Combine("file:///", path);
            var url      = new Uri(path);

            driver.Navigate().GoToUrl(url);

            var values = new Dictionary <string, double>();

            foreach (var elementName in elementNames)
            {
                var element = driver.FindElement(By.Id(elementName));
                var value   = double.Parse(element.Text);
                values.Add(elementName, value);
            }

            driver.Quit();
            File.Delete(path);

            return(values);
        }
Esempio n. 14
0
        static void Main(string[] args)
        {
            // web parser
            //BrowserDemo.OpenHtmlUnitDriver();
            // BrowserDemo.OpenPhantomJs();

            //TrackingDemo.TrackWithoutBrowser();
            //TrackingDemo.TrackWithChrome();

            // start http server
            //using (var server = new HttpServer("http://*****:*****@" <!DOCTYPE html><!--29175c33-bb68-31a4-a326-3fc888d22e35_v33--><html><head><meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;></meta><style id=&quot;DS3Style&quot; type=&quot;text/css&quot;>@media only screen and (max-width: 620px) {body[yahoo] .device-width {	width: 450px !important}body[yahoo] .threeColumns {	width: 140px !important}body[yahoo] .threeColumnsTd {	padding: 10px 4px !important}body[yahoo] .fourColumns {	width: 225px !important}body[yahoo] .fourColumnsLast {	width: 225px !important}body[yahoo] .fourColumnsTd {	padding: 10px 0px !important}body[yahoo] .fourColumnsPad {	padding: 0 0 0 0 !important}body[yahoo] .secondary-product-image {	width: 200px !important;	height: 200px !important}body[yahoo] .center {	text-align: center !important}body[yahoo] .twoColumnForty {	width: 200px !importantheight: 200px !important}body[yahoo] .twoColumnForty img {	width: 200px !important;	height: 200px !important}body[yahoo] .twoColumnSixty {	width: 228px !important}body[yahoo] .secondary-subhead-right {	display: none !important}body[yahoo] .secondary-subhead-left {	width: 450px !important}}@media only screen and (max-width: 479px) {body[yahoo] .navigation {	display: none !important}body[yahoo] .device-width {	width: 300px !important;	padding: 0}body[yahoo] .threeColumns {	width: 150px !important}body[yahoo] .fourColumns {	width: 150px !important}body[yahoo] .fourColumnsLast {	width: 150px !important}body[yahoo] .fourColumnsTd {	padding: 10px 0px !important}body[yahoo] .fourColumnsPad {	padding: 0 0 0 0 !important}body[yahoo] .secondary-product-image {	width: 240px !important;	height: 240px !important}body[yahoo] .single-product-table {	float: none !important;margin-bottom: 10px !important;margin-right: auto !important;margin-left: auto !important;}body[yahoo] .single-product-pad {	padding: 0 0 0 0 !important;}body[yahoo] .single-product-image {align:center;width: 200px !important;height: 200px !important}body[yahoo] .mobile-full-width {	width: 300px !important}body[yahoo] .twoColumnForty {align:center; !importantwidth: 200px !important}body[yahoo] .twoColumnForty img {}body[yahoo] .twoColumnSixty {padding-left: 0px !important;width: 300px !important}body[yahoo] .secondary-subhead-left {	width: 300px !important}body[yahoo] .ThreeColumnItemTable{        padding: 0px 0px 0px 74px !important}body[yahoo] .FourColumnFloater{float: right !important;}span.message-history{text-align: left !important;float: right !important;}}body[yahoo] .mobile-full-width {	min-width: 103px;max-width: 300px;height: 38px;}body[yahoo] .mobile-full-width a {	display: block;padding: 10px 0;}body[yahoo] .mobile-full-width td{	padding: 0px !important}td.wrapText{white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; }@-moz-document url-prefix() {td.wrapTextFF_Fix {display: inline-block}}body { width: 100% !important; -webkit-text-size-adjust: 100% !important; -ms-text-size-adjust: 100% !important; -webkit-font-smoothing: antialiased !important; margin: 0 !important; padding: 0 0 100px !important; font-family: Helvetica, Arial, sans-serif !important; background-color:#f9f9f9}.ReadMsgBody { width: 100% !important; background-color: #ffffff !important; }.ExternalClass { width: 100% !important; }.ExternalClass { line-height: 100% !important; }img { display: block; outline: none !important; text-decoration: none !important; -ms-interpolation-mode: bicubic !important; }td{word-wrap: break-word;}</style><!--[if gte mso 9]>	<style>td.product-details-block{word-break:break-all}.threeColumns{width:140px !important}.threeColumnsTd{padding:10px 20px !important}.fourColumns{width:158px !important}.fourColumnsPad{padding: 0 18px 0 0 !important}.fourColumnsTd{padding:10px 0px !important}.twoColumnSixty{width:360px !important}table{mso-table-lspace:0pt; mso-table-rspace:0pt;}</style>	<![endif]--></head><body yahoo=&quot;fix&quot;><table id=&quot;area2Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9&quot;><tr><td width=&quot;100%&quot; valign=&quot;top&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><table width=&quot;600&quot; class=&quot;device-width header-logo&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; bgcolor=&quot;#f9f9f9&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><tr><td valign=&quot;top&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; padding: 0; border: none;&quot;><p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 5px 0 10px 0; color: #333;&quot; align=&quot;left&quot;>New message: Hi Kobo,As a buyer, I am interest...</p></td></tr></table></td></tr></table> <table id=&quot;area3Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse:collapse !important;border-spacing:0 !important;border:none;background-color:#f9f9f9;&quot;><tr><td width=&quot;100%&quot; valign=&quot;top&quot; style=&quot;border-collapse:collapse !important;border-spacing:0 !important;border:none;&quot;><table width=&quot;100%&quot; height=&quot;7&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url(&apos;http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png&apos;); background-repeat: repeat-y no-repeat; margin: 0; padding: 0&quot;><!--[if gte mso 9]><v:rect xmlns:v=&quot;urn:schemas-microsoft-com:vml&quot; fill=&quot;true&quot; stroke=&quot;false&quot; style=&quot;mso-width-percent:1000;height:1px;&quot;><v:fill type=&quot;tile&quot; color=&quot;#dddddd&quot; /></v:rect><v:rect xmlns:v=&quot;urn:schemas-microsoft-com:vml&quot; fill=&quot;true&quot; stroke=&quot;false&quot; style=&quot;mso-width-percent:1000;height:6px;&quot;><v:fill type=&quot;tile&quot; src=&quot;http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png&quot; color=&quot;#f9f9f9&quot; /><div style=&quot;width:0px; height:0px; overflow:hidden; display:none; visibility:hidden; mso-hide:all;&quot;><![endif]--><tr><td width=&quot;100%&quot; height=&quot;1&quot; valign=&quot;top&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd; font-size: 1px; line-height: 1px;&quot;><!--[if gte mso 15]>&amp;nbsp;<![endif]--></td></tr><tr><td width=&quot;100%&quot; height=&quot;6&quot; valign=&quot;top&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none; font-size: 1px; line-height: 1px;&quot;>&amp;nbsp;</td></tr><!--[if gte mso 9]></div></v:rect><![endif]--></table></td></tr></table>   <table id=&quot;area4Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9&quot;><tr><td width=&quot;100%&quot; valign=&quot;top&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><table width=&quot;600&quot; class=&quot;device-width header-logo&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><tr><td valign=&quot;top&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; padding: 15px 0 20px; border: none;&quot;><a href=&quot;http://rover.ebay.com/rover/0/e12050.m1831.l3127/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Dhome%26alt%3Dweb%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m1831.l3127%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1&quot; style=&quot;text-decoration: none; color: #0654ba;&quot;><img src=&quot;http://p.ebaystatic.com/aw/logos/header_ebay_logo_132x46.gif&quot; width=&quot;132&quot; height=&quot;46&quot; border=&quot;0&quot; alt=&quot;eBay&quot; align=&quot;left&quot; style=&quot;display: inline block; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: none;&quot; /></a><img src=&quot;http://rover.ebay.com/roveropen/0/e12050/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&quot; alt=&quot;&quot; style=&quot;border:0; height:1;&quot;/></td></tr></table></td></tr></table> <table id=&quot;area5Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; background-color:#f9f9f9&quot;>  <tr>    <td width=&quot;100%&quot; valign=&quot;top&quot;   style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>    <table id=&quot;PrimaryMessage&quot; width=&quot;600&quot; class=&quot;device-width&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; bgcolor=&quot;#f9f9f9&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>      <tr><td valign=&quot;top&quot; class=&quot;secondary-headline&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; padding: 20px 0 5px;&quot;><h1 style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 15px; color: #808284; text-align: left; font-size: 13px; margin: 0 0 4px;&quot; align=&quot;left&quot;>New message from:<a href=&quot;http://rover.ebay.com/rover/0/e12050.m44.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Duser.view%26user%3Dandfen6%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m44.l1181%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1&quot; style=&quot;text-decoration: none; font-weight: bold; color: #336fb7;&quot;>andfen6</a><a href=&quot;http://rover.ebay.com/rover/0/e12050.m44.l1183/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Ffeedback.ebay.ca%2Fws%2FeBayISAPI.dll%3FViewFeedback%26userid%3Dandfen6%26ssPageName%3DSTRK%3AME%3AUFS&quot; style=&quot;text-decoration: none; color: #888888;&quot;>(5)</a></h1></td></tr>            <tr><td valign=&quot;top&quot; class=&quot;viewing-problem-block&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border-bottom-width: 1px; border-bottom-color: #f9f9f9; padding: 10px 0 30px; border-style: none none solid;&quot;>          <table width=&quot;600&quot; class=&quot;device-width&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; border:0; cellpadding:0; cellspacing:0; align:center; bgcolor:#f9f9f9;&quot;>               <tr><td width=&quot;100%&quot; class=&quot;wrapText device-width&quot; valign=&quot;top&quot; style=&quot;overflow: hidden; border-collapse: collapse !important; border-spacing: 0 !important; border: none; display: inline-block; max-width:600px;&quot;><h3 style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; color: #231f20; text-align: left; font-size: 14px; margin: 0 0 2px; font-weight:none;&quot; align=&quot;left&quot;><div id=&quot;UserInputtedText&quot;>Hi Kobo,<br /><br />As a buyer, I am interested....<br /><br />this is a test message</div></h3>                    <span style=&quot;color:#666666&quot;></span>				</td></tr>              <tr><td valign=&quot;top&quot; width=&quot;15&quot; height=&quot;15&quot; style=&quot;border-collapse: collapse !important; border-spacing: 20 !important; border: none;&quot;></td></tr>              <tr><td valign=&quot;top&quot; class=&quot;cta-block&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; padding: 5px 0 5px; border: none;&quot;><table align=&quot;left&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; class=&quot;mobile-full-width&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><tr><td valign=&quot;top&quot; class=&quot;center cta-button primary-cta-button&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; font-size: 14px; line-height: normal; font-weight: bold; box-shadow: 2px 3px 0 #e5e5e5; filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=&apos;#0079bc&apos;, endColorstr=&apos;#00519e&apos;,GradientType=0 ); background-image: linear-gradient(to bottom,  #0079bc 0%,#00519e 100%); background-color: #0079bc; padding: 10px 17px; border: 1px solid #00519e;&quot; bgcolor=&quot;#0079bc&quot;><a href=&quot;http://rover.ebay.com/rover/0/e12050.m44.l1139/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fcontact.ebay.ca%2Fws%2FeBayISAPI.dll%3FM2MContact%26requested%3Dandfen6%26qid%3D1291497258010%26redirect%3D0&quot; style=&quot;text-decoration: none; color: #ffffff; font-size: 14px; line-height: normal; font-weight: bold; font-family: Helvetica, Arial, sans-serif; text-shadow: 1px 1px 0 #00519e;&quot;><span style=&quot;padding: 0px 10px&quot;>Reply</span></a></td></tr></table>                </td></tr>           </table></td></tr></table>    <!--[if !mso]><!--><div id=&quot;V4PrimaryMessage&quot;  style=&quot;max-height: 0px; font-size: 0; overflow:hidden; display: none !important;&quot;><div><table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;3&quot; width=&quot;100%&quot;><tr><td><font style=&quot;font-size:10pt; font-family:arial, sans-serif; color:#000&quot;><strong>Dear rakutenkobo,</strong><br><br>Hi Kobo,<br /><br />As a buyer, I am interested....<br /><br />this is a test message<br><br></font><div style=&quot;font-weight:bold; font-size:10pt; font-family:arial, sans-serif; color:#000&quot;>- andfen6</div></td><td valign=&quot;top&quot; width=&quot;185&quot;><div></div></td></tr></table></div></div><!--<![endif]-->	</td>  </tr></table> <table id=&quot;area3Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9&quot;>    <tr>      <td width=&quot;100%&quot; valign=&quot;top&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><table width=&quot;100%&quot; height=&quot;7&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url(&amp;#39;http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png&amp;#39;); background-repeat: repeat-y no-repeat; margin: 0; padding: 0&quot;>  <tr><td width=&quot;100%&quot; height=&quot;1&quot; valign=&quot;top&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd;&quot;></td></tr>  <tr><td width=&quot;100%&quot; height=&quot;6&quot; valign=&quot;top&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none;&quot;></td></tr></table>      </td>    </tr>  </table> <table id=&quot;area7Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9;&quot;>  <tr>    <td width=&quot;100%&quot; valign=&quot;top&quot;   style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>    <table width=&quot;600&quot; class=&quot;device-width&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; bgcolor=&quot;#f9f9f9&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>            <tr><td valign=&quot;top&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; padding-right:20px;&quot;><h1 style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: bold; line-height: 22px; color: #808284; text-align: left; font-size: 16px; text-align: left; margin-top: 0px; border-style: none none solid; border-bottom-color: #dddddd; border-bottom-width: 1px;&quot; align=&quot;left&quot;>Get to know <a href=&quot;http://rover.ebay.com/rover/0/e12050.m3965.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Duser.view%26user%3Dandfen6%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m3965.l1181%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1&quot; style=&quot;text-decoration: none; color: #336fb7;&quot;>andfen6</a> </h1><table style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; text-align: left; font-size: 14px; margin-bottom: 10px; padding-bottom: 10px;&quot; align=&quot;left&quot;><tr><td valign=&quot;top&quot; style=&quot;font-size: 20px; padding-left: 15px; padding-right: 5px;&quot;>&amp;bull;</td><td style=&quot;padding-bottom: 5px&quot;>Located: Toronto, ON, Canada</td></tr><tr><td valign=&quot;top&quot; style=&quot;font-size: 20px; padding-left: 15px; padding-right: 5px;&quot;>&amp;bull;</td><td style=&quot;padding-bottom: 5px&quot;>Member since: Dec 17, 2015</td></tr><tr><td valign=&quot;top&quot; style=&quot;font-size: 20px; padding-left: 15px; padding-right: 5px;&quot;>&amp;bull;</td><td style=&quot;padding-bottom: 5px&quot;>Positive Feedback: 100%</td></tr></table></td></tr></table></td></tr></table>  <table id=&quot;area10Container&quot; class=&quot;whiteSection&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff&quot;>  <tr>    <td width=&quot;100%&quot; valign=&quot;top&quot;   style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>            <table width=&quot;600&quot; class=&quot;device-width&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; bgcolor=&quot;#ffffff&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><tr><td valign=&quot;top&quot; class=&quot;viewing-problem-block&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border-bottom-width: 1px; border-bottom-color: #dddddd; padding: 40px 0 30px; border-style: none none solid;&quot;><p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;&quot; align=&quot;center&quot;>Only purchases on eBay are covered by the eBay purchase protection programs. Asking your trading partner to complete a transaction outside of eBay is not allowed.</p></td></tr></table>	</td>  </tr></table> <table id=&quot;area11Container&quot; class=&quot;whiteSection&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff&quot;><tr><td width=&quot;100%&quot; valign=&quot;top&quot;   style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>              <table width=&quot;600&quot; class=&quot;device-width&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot;   style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><tr><td valign=&quot;top&quot; class=&quot;ebay-footer-block&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; padding: 40px 0 60px; border: none;&quot;>        <div id=&quot;ReferenceId&quot;><p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;&quot; align=&quot;left&quot;><strong>Email reference id: [#a05-c1pifaockd#]_[#68fe0bd048d04a84b6d8ef4046dde4cd#]</strong></p></div><p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;&quot; align=&quot;left&quot;>We don&apos;t check this mailbox, so please don&apos;t reply to this message. If you have a question, go to <a style=&quot;text-decoration: none; color: #555555;&quot; href=&quot;http://rover.ebay.com/rover/0/e12050.m1852.l6369/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Focsnext.ebay.ca%2Focs%2Fhome&quot; target=&quot;_blank&quot;>Help &amp; Contact</a>.</p>		    <p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;&quot; align=&quot;left&quot;>eBay sent this message to Nantha Gopalasamy (rakutenkobo). Learn more about <a style=&quot;text-decoration: none; color: #555555;&quot; href=&quot;http://rover.ebay.com/rover/0/e12050.m1852.l3167/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Faccount%2Fprotecting-account.html&quot; target=&quot;_blank&quot;>account protection</a>. eBay is committed to your privacy. Learn more about our <a style=&quot;text-decoration: none; color: #555555;&quot; href=&quot;http://rover.ebay.com/rover/0/e12050.m1852.l3168/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fprivacy-policy.html&quot; target=&quot;_blank&quot;>privacy policy</a> and <a style=&quot;text-decoration: none; color: #555555;&quot; href=&quot;http://rover.ebay.com/rover/0/e12050.m1852.l3165/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fuser-agreement.html&quot; target=&quot;_blank&quot;>user agreement</a>.</p><p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;&quot; align=&quot;left&quot;>&amp;copy;2016 eBay Inc., eBay International AG Helvetiastrasse 15/17 - P.O. Box 133, 3000 Bern 6, Switzerland</p></td></tr></table></td></tr></table></body></html>"))
            //{
            //    Thread thread = new Thread(server.Start);
            //    thread.IsBackground = false;
            //    thread.Start();
            //    Console.WriteLine("server started");
            //    using (var driver = new PhantomJSDriver())
            //    {
            //        WebDriverWait driverWait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
            //        driver.Manage().Window.Maximize();
            //        driver.Navigate().GoToUrl("http://*****:*****@" <!DOCTYPE html><!--29175c33-bb68-31a4-a326-3fc888d22e35_v33--><html><head><meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;></meta><style id=&quot;DS3Style&quot; type=&quot;text/css&quot;>@media only screen and (max-width: 620px) {body[yahoo] .device-width {	width: 450px !important}body[yahoo] .threeColumns {	width: 140px !important}body[yahoo] .threeColumnsTd {	padding: 10px 4px !important}body[yahoo] .fourColumns {	width: 225px !important}body[yahoo] .fourColumnsLast {	width: 225px !important}body[yahoo] .fourColumnsTd {	padding: 10px 0px !important}body[yahoo] .fourColumnsPad {	padding: 0 0 0 0 !important}body[yahoo] .secondary-product-image {	width: 200px !important;	height: 200px !important}body[yahoo] .center {	text-align: center !important}body[yahoo] .twoColumnForty {	width: 200px !importantheight: 200px !important}body[yahoo] .twoColumnForty img {	width: 200px !important;	height: 200px !important}body[yahoo] .twoColumnSixty {	width: 228px !important}body[yahoo] .secondary-subhead-right {	display: none !important}body[yahoo] .secondary-subhead-left {	width: 450px !important}}@media only screen and (max-width: 479px) {body[yahoo] .navigation {	display: none !important}body[yahoo] .device-width {	width: 300px !important;	padding: 0}body[yahoo] .threeColumns {	width: 150px !important}body[yahoo] .fourColumns {	width: 150px !important}body[yahoo] .fourColumnsLast {	width: 150px !important}body[yahoo] .fourColumnsTd {	padding: 10px 0px !important}body[yahoo] .fourColumnsPad {	padding: 0 0 0 0 !important}body[yahoo] .secondary-product-image {	width: 240px !important;	height: 240px !important}body[yahoo] .single-product-table {	float: none !important;margin-bottom: 10px !important;margin-right: auto !important;margin-left: auto !important;}body[yahoo] .single-product-pad {	padding: 0 0 0 0 !important;}body[yahoo] .single-product-image {align:center;width: 200px !important;height: 200px !important}body[yahoo] .mobile-full-width {	width: 300px !important}body[yahoo] .twoColumnForty {align:center; !importantwidth: 200px !important}body[yahoo] .twoColumnForty img {}body[yahoo] .twoColumnSixty {padding-left: 0px !important;width: 300px !important}body[yahoo] .secondary-subhead-left {	width: 300px !important}body[yahoo] .ThreeColumnItemTable{        padding: 0px 0px 0px 74px !important}body[yahoo] .FourColumnFloater{float: right !important;}span.message-history{text-align: left !important;float: right !important;}}body[yahoo] .mobile-full-width {	min-width: 103px;max-width: 300px;height: 38px;}body[yahoo] .mobile-full-width a {	display: block;padding: 10px 0;}body[yahoo] .mobile-full-width td{	padding: 0px !important}td.wrapText{white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; }@-moz-document url-prefix() {td.wrapTextFF_Fix {display: inline-block}}body { width: 100% !important; -webkit-text-size-adjust: 100% !important; -ms-text-size-adjust: 100% !important; -webkit-font-smoothing: antialiased !important; margin: 0 !important; padding: 0 0 100px !important; font-family: Helvetica, Arial, sans-serif !important; background-color:#f9f9f9}.ReadMsgBody { width: 100% !important; background-color: #ffffff !important; }.ExternalClass { width: 100% !important; }.ExternalClass { line-height: 100% !important; }img { display: block; outline: none !important; text-decoration: none !important; -ms-interpolation-mode: bicubic !important; }td{word-wrap: break-word;}</style><!--[if gte mso 9]>	<style>td.product-details-block{word-break:break-all}.threeColumns{width:140px !important}.threeColumnsTd{padding:10px 20px !important}.fourColumns{width:158px !important}.fourColumnsPad{padding: 0 18px 0 0 !important}.fourColumnsTd{padding:10px 0px !important}.twoColumnSixty{width:360px !important}table{mso-table-lspace:0pt; mso-table-rspace:0pt;}</style>	<![endif]--></head><body yahoo=&quot;fix&quot;><table id=&quot;area2Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9&quot;><tr><td width=&quot;100%&quot; valign=&quot;top&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><table width=&quot;600&quot; class=&quot;device-width header-logo&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; bgcolor=&quot;#f9f9f9&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><tr><td valign=&quot;top&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; padding: 0; border: none;&quot;><p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 5px 0 10px 0; color: #333;&quot; align=&quot;left&quot;>New message: Hi Kobo,As a buyer, I am interest...</p></td></tr></table></td></tr></table> <table id=&quot;area3Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse:collapse !important;border-spacing:0 !important;border:none;background-color:#f9f9f9;&quot;><tr><td width=&quot;100%&quot; valign=&quot;top&quot; style=&quot;border-collapse:collapse !important;border-spacing:0 !important;border:none;&quot;><table width=&quot;100%&quot; height=&quot;7&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url(&apos;http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png&apos;); background-repeat: repeat-y no-repeat; margin: 0; padding: 0&quot;><!--[if gte mso 9]><v:rect xmlns:v=&quot;urn:schemas-microsoft-com:vml&quot; fill=&quot;true&quot; stroke=&quot;false&quot; style=&quot;mso-width-percent:1000;height:1px;&quot;><v:fill type=&quot;tile&quot; color=&quot;#dddddd&quot; /></v:rect><v:rect xmlns:v=&quot;urn:schemas-microsoft-com:vml&quot; fill=&quot;true&quot; stroke=&quot;false&quot; style=&quot;mso-width-percent:1000;height:6px;&quot;><v:fill type=&quot;tile&quot; src=&quot;http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png&quot; color=&quot;#f9f9f9&quot; /><div style=&quot;width:0px; height:0px; overflow:hidden; display:none; visibility:hidden; mso-hide:all;&quot;><![endif]--><tr><td width=&quot;100%&quot; height=&quot;1&quot; valign=&quot;top&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd; font-size: 1px; line-height: 1px;&quot;><!--[if gte mso 15]>&amp;nbsp;<![endif]--></td></tr><tr><td width=&quot;100%&quot; height=&quot;6&quot; valign=&quot;top&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none; font-size: 1px; line-height: 1px;&quot;>&amp;nbsp;</td></tr><!--[if gte mso 9]></div></v:rect><![endif]--></table></td></tr></table>   <table id=&quot;area4Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9&quot;><tr><td width=&quot;100%&quot; valign=&quot;top&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><table width=&quot;600&quot; class=&quot;device-width header-logo&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><tr><td valign=&quot;top&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; padding: 15px 0 20px; border: none;&quot;><a href=&quot;http://rover.ebay.com/rover/0/e12050.m1831.l3127/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Dhome%26alt%3Dweb%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m1831.l3127%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1&quot; style=&quot;text-decoration: none; color: #0654ba;&quot;><img src=&quot;http://p.ebaystatic.com/aw/logos/header_ebay_logo_132x46.gif&quot; width=&quot;132&quot; height=&quot;46&quot; border=&quot;0&quot; alt=&quot;eBay&quot; align=&quot;left&quot; style=&quot;display: inline block; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: none;&quot; /></a><img src=&quot;http://rover.ebay.com/roveropen/0/e12050/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&quot; alt=&quot;&quot; style=&quot;border:0; height:1;&quot;/></td></tr></table></td></tr></table> <table id=&quot;area5Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; background-color:#f9f9f9&quot;>  <tr>    <td width=&quot;100%&quot; valign=&quot;top&quot;   style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>    <table id=&quot;PrimaryMessage&quot; width=&quot;600&quot; class=&quot;device-width&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; bgcolor=&quot;#f9f9f9&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>      <tr><td valign=&quot;top&quot; class=&quot;secondary-headline&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; padding: 20px 0 5px;&quot;><h1 style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 15px; color: #808284; text-align: left; font-size: 13px; margin: 0 0 4px;&quot; align=&quot;left&quot;>New message from:<a href=&quot;http://rover.ebay.com/rover/0/e12050.m44.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Duser.view%26user%3Dandfen6%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m44.l1181%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1&quot; style=&quot;text-decoration: none; font-weight: bold; color: #336fb7;&quot;>andfen6</a><a href=&quot;http://rover.ebay.com/rover/0/e12050.m44.l1183/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Ffeedback.ebay.ca%2Fws%2FeBayISAPI.dll%3FViewFeedback%26userid%3Dandfen6%26ssPageName%3DSTRK%3AME%3AUFS&quot; style=&quot;text-decoration: none; color: #888888;&quot;>(5)</a></h1></td></tr>            <tr><td valign=&quot;top&quot; class=&quot;viewing-problem-block&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border-bottom-width: 1px; border-bottom-color: #f9f9f9; padding: 10px 0 30px; border-style: none none solid;&quot;>          <table width=&quot;600&quot; class=&quot;device-width&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; border:0; cellpadding:0; cellspacing:0; align:center; bgcolor:#f9f9f9;&quot;>               <tr><td width=&quot;100%&quot; class=&quot;wrapText device-width&quot; valign=&quot;top&quot; style=&quot;overflow: hidden; border-collapse: collapse !important; border-spacing: 0 !important; border: none; display: inline-block; max-width:600px;&quot;><h3 style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; color: #231f20; text-align: left; font-size: 14px; margin: 0 0 2px; font-weight:none;&quot; align=&quot;left&quot;><div id=&quot;UserInputtedText&quot;>Hi Kobo,<br /><br />As a buyer, I am interested....<br /><br />this is a test message</div></h3>                    <span style=&quot;color:#666666&quot;></span>				</td></tr>              <tr><td valign=&quot;top&quot; width=&quot;15&quot; height=&quot;15&quot; style=&quot;border-collapse: collapse !important; border-spacing: 20 !important; border: none;&quot;></td></tr>              <tr><td valign=&quot;top&quot; class=&quot;cta-block&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; padding: 5px 0 5px; border: none;&quot;><table align=&quot;left&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; class=&quot;mobile-full-width&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><tr><td valign=&quot;top&quot; class=&quot;center cta-button primary-cta-button&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; font-size: 14px; line-height: normal; font-weight: bold; box-shadow: 2px 3px 0 #e5e5e5; filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=&apos;#0079bc&apos;, endColorstr=&apos;#00519e&apos;,GradientType=0 ); background-image: linear-gradient(to bottom,  #0079bc 0%,#00519e 100%); background-color: #0079bc; padding: 10px 17px; border: 1px solid #00519e;&quot; bgcolor=&quot;#0079bc&quot;><a href=&quot;http://rover.ebay.com/rover/0/e12050.m44.l1139/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fcontact.ebay.ca%2Fws%2FeBayISAPI.dll%3FM2MContact%26requested%3Dandfen6%26qid%3D1291497258010%26redirect%3D0&quot; style=&quot;text-decoration: none; color: #ffffff; font-size: 14px; line-height: normal; font-weight: bold; font-family: Helvetica, Arial, sans-serif; text-shadow: 1px 1px 0 #00519e;&quot;><span style=&quot;padding: 0px 10px&quot;>Reply</span></a></td></tr></table>                </td></tr>           </table></td></tr></table>    <!--[if !mso]><!--><div id=&quot;V4PrimaryMessage&quot;  style=&quot;max-height: 0px; font-size: 0; overflow:hidden; display: none !important;&quot;><div><table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;3&quot; width=&quot;100%&quot;><tr><td><font style=&quot;font-size:10pt; font-family:arial, sans-serif; color:#000&quot;><strong>Dear rakutenkobo,</strong><br><br>Hi Kobo,<br /><br />As a buyer, I am interested....<br /><br />this is a test message<br><br></font><div style=&quot;font-weight:bold; font-size:10pt; font-family:arial, sans-serif; color:#000&quot;>- andfen6</div></td><td valign=&quot;top&quot; width=&quot;185&quot;><div></div></td></tr></table></div></div><!--<![endif]-->	</td>  </tr></table> <table id=&quot;area3Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9&quot;>    <tr>      <td width=&quot;100%&quot; valign=&quot;top&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><table width=&quot;100%&quot; height=&quot;7&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url(&amp;#39;http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png&amp;#39;); background-repeat: repeat-y no-repeat; margin: 0; padding: 0&quot;>  <tr><td width=&quot;100%&quot; height=&quot;1&quot; valign=&quot;top&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd;&quot;></td></tr>  <tr><td width=&quot;100%&quot; height=&quot;6&quot; valign=&quot;top&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none;&quot;></td></tr></table>      </td>    </tr>  </table> <table id=&quot;area7Container&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9;&quot;>  <tr>    <td width=&quot;100%&quot; valign=&quot;top&quot;   style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>    <table width=&quot;600&quot; class=&quot;device-width&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; bgcolor=&quot;#f9f9f9&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>            <tr><td valign=&quot;top&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; padding-right:20px;&quot;><h1 style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: bold; line-height: 22px; color: #808284; text-align: left; font-size: 16px; text-align: left; margin-top: 0px; border-style: none none solid; border-bottom-color: #dddddd; border-bottom-width: 1px;&quot; align=&quot;left&quot;>Get to know <a href=&quot;http://rover.ebay.com/rover/0/e12050.m3965.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Duser.view%26user%3Dandfen6%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m3965.l1181%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1&quot; style=&quot;text-decoration: none; color: #336fb7;&quot;>andfen6</a> </h1><table style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; text-align: left; font-size: 14px; margin-bottom: 10px; padding-bottom: 10px;&quot; align=&quot;left&quot;><tr><td valign=&quot;top&quot; style=&quot;font-size: 20px; padding-left: 15px; padding-right: 5px;&quot;>&amp;bull;</td><td style=&quot;padding-bottom: 5px&quot;>Located: Toronto, ON, Canada</td></tr><tr><td valign=&quot;top&quot; style=&quot;font-size: 20px; padding-left: 15px; padding-right: 5px;&quot;>&amp;bull;</td><td style=&quot;padding-bottom: 5px&quot;>Member since: Dec 17, 2015</td></tr><tr><td valign=&quot;top&quot; style=&quot;font-size: 20px; padding-left: 15px; padding-right: 5px;&quot;>&amp;bull;</td><td style=&quot;padding-bottom: 5px&quot;>Positive Feedback: 100%</td></tr></table></td></tr></table></td></tr></table>  <table id=&quot;area10Container&quot; class=&quot;whiteSection&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff&quot;>  <tr>    <td width=&quot;100%&quot; valign=&quot;top&quot;   style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>    		<table width=&quot;600&quot; class=&quot;device-width&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; bgcolor=&quot;#ffffff&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><tr><td valign=&quot;top&quot; class=&quot;viewing-problem-block&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border-bottom-width: 1px; border-bottom-color: #dddddd; padding: 40px 0 30px; border-style: none none solid;&quot;><p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;&quot; align=&quot;center&quot;>Only purchases on eBay are covered by the eBay purchase protection programs. Asking your trading partner to complete a transaction outside of eBay is not allowed.</p></td></tr></table>	</td>  </tr></table> <table id=&quot;area11Container&quot; class=&quot;whiteSection&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff&quot;><tr><td width=&quot;100%&quot; valign=&quot;top&quot;   style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;>              <table width=&quot;600&quot; class=&quot;device-width&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;center&quot;   style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; border: none;&quot;><tr><td valign=&quot;top&quot; class=&quot;ebay-footer-block&quot; style=&quot;border-collapse: collapse !important; border-spacing: 0 !important; padding: 40px 0 60px; border: none;&quot;>   		<div id=&quot;ReferenceId&quot;><p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;&quot; align=&quot;left&quot;><strong>Email reference id: [#a05-c1pifaockd#]_[#68fe0bd048d04a84b6d8ef4046dde4cd#]</strong></p></div><p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;&quot; align=&quot;left&quot;>We don&apos;t check this mailbox, so please don&apos;t reply to this message. If you have a question, go to <a style=&quot;text-decoration: none; color: #555555;&quot; href=&quot;http://rover.ebay.com/rover/0/e12050.m1852.l6369/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Focsnext.ebay.ca%2Focs%2Fhome&quot; target=&quot;_blank&quot;>Help &amp; Contact</a>.</p>		    <p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;&quot; align=&quot;left&quot;>eBay sent this message to Nantha Gopalasamy (rakutenkobo). Learn more about <a style=&quot;text-decoration: none; color: #555555;&quot; href=&quot;http://rover.ebay.com/rover/0/e12050.m1852.l3167/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Faccount%2Fprotecting-account.html&quot; target=&quot;_blank&quot;>account protection</a>. eBay is committed to your privacy. Learn more about our <a style=&quot;text-decoration: none; color: #555555;&quot; href=&quot;http://rover.ebay.com/rover/0/e12050.m1852.l3168/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fprivacy-policy.html&quot; target=&quot;_blank&quot;>privacy policy</a> and <a style=&quot;text-decoration: none; color: #555555;&quot; href=&quot;http://rover.ebay.com/rover/0/e12050.m1852.l3165/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&amp;loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fuser-agreement.html&quot; target=&quot;_blank&quot;>user agreement</a>.</p><p style=&quot;font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;&quot; align=&quot;left&quot;>&amp;copy;2016 eBay Inc., eBay International AG Helvetiastrasse 15/17 - P.O. Box 133, 3000 Bern 6, Switzerland</p></td></tr></table></td></tr></table></body></html>");
                {
                    server.Start();
                    Console.WriteLine("server started");
                    driver.Manage().Window.Maximize();
                    driver.Navigate().GoToUrl("http://localhost:7104/message/");
                    var element = driver.FindElement(By.Id("UserInputtedText"));
                    Console.WriteLine(element.Text);

                    for (int i = 0; i < 100; i++)
                    {
                        server.SetService("new content: " + i);
                        driver.Navigate().GoToUrl("http://localhost:7104/message/");
                        Console.WriteLine(driver.PageSource);
                    }
                }
            }



            // start async http server
            //HttpServerAsync.ListenAsync();
            //WebClient wc = new WebClient(); // Make a client request.
            //Console.WriteLine(wc.DownloadString
            //("http://localhost:51111/MyApp/Request.txt"));

            // local parser
            //LocalParser.Process();
        }
Esempio n. 15
0
 private void ExecuteAction(Operation operation, PhantomJSDriver driver)
 {
     if (driver.FindElement(By.XPath(operation.ExtentionData2)).Displayed&& !driver.FindElement(By.XPath(operation.ExtentionData3)).Displayed)
     {
         operation.Action?.Invoke(driver);
         var driverWait = new WebDriverWait(driver, TimeSpan.FromMilliseconds(operation.Timeout));
         if (operation.Condition != null)
         {
             driverWait.Until(operation.Condition);
         }
         ExecuteAction(operation, driver);
     }
     else if (driver.FindElement(By.XPath(operation.ExtentionData3)).Displayed)
     {
         return;
     }
 }
        public void Login(string userName, string password)
        {
            string loginUrl = "https://instagram.com/accounts/login/";

            NavigateToUrl(loginUrl);

            var pageRoot = _driver.FindElement(By.Id("react-root"));

            var userNameElement = pageRoot.FindElement(By.Name("username"));
            var passwordElement = pageRoot.FindElement(By.Name("password"));
            var buttonElement = pageRoot.FindElement(By.TagName("button"));

            userNameElement.SendKeys(userName);
            passwordElement.SendKeys(password);

            buttonElement.Click();
        }
Esempio n. 17
0
        public async Task <int> SetIp(string ip, string userEmail)
        {
            IWebDriver browser;
            var        driverdir = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            browser = new PhantomJSDriver(driverdir);
            browser.Manage().Window.Maximize();
            browser.Navigate().GoToUrl("https://www.sharedproxies.com/user.php?s=api");

            IWebElement name     = browser.FindElement(By.Id("Username"));
            IWebElement password = browser.FindElement(By.Name("Password"));

            name.SendKeys("lebedev1");
            password.SendKeys("PfTcjijzIQHZHmzVRx1z" + Keys.Enter);

            IWebElement home = browser.FindElements(By.ClassName("buttonscontainer1")).First().FindElements(By.ClassName("buttons4")).First().FindElement(By.TagName("a"));

            home.Click();

            browser.FindElements(By.TagName("a")).First(f => f.Text == "Change Authorized IPs").Click();


            List <IWebElement> ips = browser.FindElement(By.Id("addipform")).FindElements(By.TagName("input")).ToList();
            bool isNullContains    = false;
            int  idValue           = 0;

            for (int i = 0; (ips.Count() - 1) > i; i++)
            {
                if (ips[i].GetAttribute("value") == "")
                {
                    isNullContains = true;
                    idValue        = i;
                    break;
                }
            }
            if (!isNullContains)
            {
                return(1);
            }
            ips[idValue].SendKeys(ip);
            IWebElement submitButton = browser.FindElements(By.TagName("input")).First(s => s.GetAttribute("value") == "Save Authorized IPs");

            submitButton.Click();
            return(2);
        }
Esempio n. 18
0
        public List <Song> GetSearch()
        {
            List <Song> search_results = new List <Song>();
            IReadOnlyCollection <IWebElement> search_content;
            List <string> search_content_ids = new List <string>();

            var service = PhantomJSDriverService.CreateDefaultService();

            service.HideCommandPromptWindow = true;
            IWebDriver driver = new PhantomJSDriver(service);

            driver.Url = "http://www.playzer.fr";

            IJavaScriptExecutor js = (IJavaScriptExecutor)driver;


            js.ExecuteScript("arguments[0].click();", driver.FindElement(By.XPath("//*[@id='panel_search']/img")));
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
            Thread.Sleep(TimeSpan.FromSeconds(1));
            IWebElement search = driver.FindElement(By.Id("search_engine"));

            search.SendKeys(searchBox.Text);
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
            Thread.Sleep(TimeSpan.FromSeconds(2));
            js.ExecuteScript("arguments[0].click();", driver.FindElement(By.XPath("//*[@id='search_clips_tab']")));
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
            // Thread.Sleep(TimeSpan.FromSeconds(2));
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
            IWebElement result = driver.FindElement(By.Id("search_results"));

            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
            //  Thread.Sleep(TimeSpan.FromSeconds(2));
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
            search_content = result.FindElements(By.XPath("//div[@class='content transition search_item_content']"));
            //   Thread.Sleep(TimeSpan.FromSeconds(2));
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));

            int i = 1;

            foreach (IWebElement ids in search_content)
            {
                string song_ID = ids.GetAttribute("id");

                string title = driver.FindElement(By.XPath("//*[@id='" + song_ID + "']/div[2]")).Text;

                string artist = driver.FindElement(By.XPath("//*[@id='" + song_ID + "']/div[3]")).Text;

                string url = driver.FindElement(By.XPath("//*[@id='" + song_ID + "']/div[1]/img[2]")).GetAttribute("src");

                search_results.Add(new Song(title, artist, song_ID,
                                            url, i));
                i++;
            }

            driver.Close();
            driver.Quit();
            driver.Dispose();

            return(search_results);
        }
Esempio n. 19
0
 public void GetData(string upc)
 {
     foreach (var site in sites)
     {
         try
         {
             Dictionary <string, string> results = new Dictionary <string, string>();
             driver.Url = "https://www.amazon.com/";
             driver.Navigate();
             RandomWait();
             driver.FindElement(By.Id("twotabsearchtextbox")).Clear();
             RandomWait();
             driver.FindElement(By.Id("twotabsearchtextbox")).SendKeys(upc);
             RandomWait();
             driver.FindElement(By.ClassName("nav-search-submit")).FindElement(By.ClassName("nav-input")).Click();
             RandomWait();
             var elem = driver.FindElement(By.CssSelector("[class='a-link-normal s-access-detail-page  s-color-twister-title-link a-text-normal']"));
             results.Add("Name", elem.Text);
             results.Add("URL", elem.GetAttribute("href"));
             driver.Url = results["URL"];
             driver.Navigate();
             RandomWait();
             results.Add("Price", driver.FindElement(By.Id("priceblock_ourprice")).Text);
             var elementsASIN = driver.FindElements(By.XPath("//th[contains(text(), 'ASIN')]/parent::tr/td"))
                                .Concat(driver.FindElements(By.XPath("//*[contains(text(), 'ASIN:')]/parent::li")));
             if (elementsASIN.Any())
             {
                 results.Add("ASIN", elementsASIN.First().Text.Replace("ASIN:", ""));
             }
             else
             {
                 // get it from URL
                 throw new Exception("Cannot find ASIN");
             }
             Directory.CreateDirectory(Path.Combine(DATA_PATH, results["ASIN"]));
             //Directory.CreateDirectory(Path.Combine(DATA_PATH, results["ASIN"], site.Name));
             File.WriteAllLines(Path.Combine(DATA_PATH, results["ASIN"], "results.txt"), results.Select(kvp => string.Join("|", kvp.Key, kvp.Value)));
         }
         catch (Exception ex)
         {
             File.WriteAllText(Path.Combine(ERROR_PATH, DateTime.Now.ToString("yyyyMMddTHHmmss") + ".html"), driver.PageSource);
         }
     }
 }
Esempio n. 20
0
        private News GetNews(PhantomJSDriver driver, CrawlerPartConfig cpc, Uri uri, int threadId, int milliseconds)
        {
            string title             = driver.FindElement(By.XPath(cpc.Title_Xpath)).Text;
            var    contentcollection = driver.FindElements(By.XPath(cpc.Content_Xpath));
            string content           = string.Empty;

            foreach (var item in contentcollection)
            {
                content += item.Text;
            }
            string   source      = string.Empty;
            string   editor      = string.Empty;
            DateTime?publishtime = null;

            if (!string.IsNullOrEmpty(cpc.Source_Xpath))
            {
                source = driver.FindElement(By.XPath(cpc.Source_Xpath)).Text;
            }
            if (!string.IsNullOrEmpty(cpc.Editor_Xpath))
            {
                editor = driver.FindElement(By.XPath(cpc.Editor_Xpath)).Text;
            }
            if (!string.IsNullOrEmpty(cpc.PublishTime_Xpath))
            {
                publishtime = Convert.ToDateTime(driver.FindElement(By.XPath(cpc.PublishTime_Xpath)).Text.TrimStart().Substring(0, 16));
            }

            News news = new News()
            {
                Id = Guid.NewGuid(),
                CrawlerConfigId = cpc.CrawlerConfigId,
                Title           = title,
                Content         = content,
                Editor          = editor,
                Source          = source,
                Address         = uri.ToString(),
                SpendTime       = milliseconds,
                ThreadId        = threadId,
                PublishTime     = publishtime
            };

            //WriteLog.InsertLogs(uri.ToString(), "步骤二");
            return(news);
        }
Esempio n. 21
0
        public static string GetPostCode(string city)
        {
            try
            {
                IWebDriver selenium = new PhantomJSDriver();
                //IWebDriver selenium = new ChromeDriver();
                selenium.Navigate().GoToUrl("http://opendata.baidu.com/post/s?wd=&p=mini&rn=20");
                var input    = selenium.FindElement(By.XPath("//input[@name=\"wd\" and @id=\"kw\"]"));
                var inputSub = selenium.FindElement(By.XPath("//input[@type=\"submit\" and @id=\"su\"]"));
                input.SendKeys(city);
                Thread.Sleep(new Random().Next(5000, 20000));
                inputSub.Click();
                IWebElement txtElement;
                try
                {
                    txtElement = selenium.FindElement(By.XPath("//article[@class=\"list-data\"]/ul/li/a"));
                }
                catch (Exception)
                {
                    throw;
                }


                if (txtElement == null)
                {
                    selenium.Close();
                    return(null);
                }
                var text = txtElement.Text;
                if (string.IsNullOrEmpty(text))
                {
                    selenium.Close();
                    return(null);
                }
                var tsplit = text.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                selenium.Close();
                return(tsplit.Last());
            }
            catch
            {
                return(null);
            }
        }
Esempio n. 22
0
        private void refresh_Click(object sender, EventArgs e)
        {
            IWebDriver driver = new PhantomJSDriver();

            driver.Navigate().GoToUrl("https://payoneer-ua.liberwing.com/");
            var driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            //var driverlil = new PhantomJSDriver(driverService);
            //Thread.Sleep(10000);
            //((IJavaScriptExecutor)driver).ExecuteScript("window.stop();");
            //--------------------------------------------------------------------------------------------
            var rate     = driver.FindElement(By.XPath("//*[@id=\"curs_pb\"]")).GetAttribute("innerHTML");
            var klocalka = driver.FindElement(By.XPath("//*[@id=\"toggleccources\"]"));

            klocalka.Click();
            var mcCustomRate = driver.FindElement(By.XPath("//*[@id=\"ccurs_mc\"]"));

            mcCustomRate.Clear();
            mcCustomRate.SendKeys(rate.ToString());
            var iSum = driver.FindElement(By.XPath("//*[@id=\"isum\"]"));

            iSum.Clear();
            USD = howmuch.Text;
            iSum.SendKeys(USD);
            var rMcUah = driver.FindElement(By.XPath("//*[@id=\"r_mc_grn\"]")).GetAttribute("innerHTML");

            //--------------------------------------------------------------------------------------------
            resultText.Text = rMcUah;
            rateText.Text   = rate;
            if (Convert.ToDouble(rMcUah) > 20050)
            {
                resultText.ForeColor = Color.Green;
            }
            else
            {
                resultText.ForeColor = Color.Red;
            }
            //UPW.Text = Convert.ToString(Convert.ToInt32(howmuch.Text) + 6);
            //UPW.Text = Convert.ToString(Convert.ToInt32(UPW.Text) * 1.3);
            //clean.Text = Convert.ToString(Convert.ToInt32(howmuch.Text) * 0.965 - 3.15);
            driver.Quit();
        }
Esempio n. 23
0
        public void VerifyExamUI(string strName, string strEmail)
        {
            //wd = new ChromeDriver(chromeOptions);
            //_wd = new InternetExplorerDriver();

            using (IWebDriver _wd = new PhantomJSDriver())
            {
                IJavaScriptExecutor _js = (IJavaScriptExecutor)_wd;

                _wd.Navigate().GoToUrl(@"http://www.lessismoore.net/exam?id=1&sf=8d679ae7-e939-474c-a3ff-8501ee636b12");
                _wd.Manage().Timeouts().ImplicitWait = new System.TimeSpan(0, 0, 10);

                IWait <IWebDriver> wait = new WebDriverWait(_wd, System.TimeSpan.FromSeconds(5));

                _wd.FindElement(By.Id("txtName")).SendKeys(strName);
                _wd.FindElement(By.Id("txtEmail")).SendKeys(strEmail);

                int[] ctrlIDs = { 101, 202, 303, 401, 504, 604, 703, 801, 902, 1003 };

                foreach (int intID in ctrlIDs)
                {
                    _wd.FindElement(By.Id("answer_" + intID.ToString())).Click();
                    _js.ExecuteScript("window.scrollBy(0,300)");
                }

                _js.ExecuteScript("window.confirm = function(msg){return true;};");
                _wd.FindElement(By.Id("txtSubmit")).Click();

                //wait.Until(ExpectedConditions.AlertIsPresent());

                //_wd.SwitchTo().Alert().Accept();

                //wait.Until(ExpectedConditions.AlertIsPresent());

                //_wd.SwitchTo().Alert().Accept();
                wait.Until(ExpectedConditions.ElementExists(By.Id("hdnScore")));

                int intScore;
                int.TryParse(_wd.FindElement(By.Id("hdnScore")).GetAttribute("value"), out intScore);

                Assert.True(intScore >= ctrlIDs.Length);
            }
        }
Esempio n. 24
0
        public void LowBloodPressureImageValidation()
        {
            using (IWebDriver driver = new PhantomJSDriver())
            {
                driver.Navigate().GoToUrl(webAppUri);

                System.Diagnostics.Debug.WriteLine(driver.PageSource);


                IWebElement diastolicElement = driver.FindElement(By.Id("BP_Diastolic"));

                clearTextBox(diastolicElement);
                diastolicElement.SendKeys("90");
                diastolicElement.SendKeys(Keys.Tab);

                WebDriverWait wait      = new WebDriverWait(driver, TimeSpan.FromSeconds(3));
                IWebElement   ambulance = driver.FindElement(By.Id("ambulanceImage"));

                Assert.IsNotNull(ambulance);

                diastolicElement = driver.FindElement(By.Id("BP_Diastolic"));
                clearTextBox(diastolicElement);
                diastolicElement.SendKeys("50");
                diastolicElement.SendKeys(Keys.Tab);

                WebDriverWait waitAgain = new WebDriverWait(driver, TimeSpan.FromSeconds(3));

                bool imagePresent;
                try {
                    IWebElement ambulanceGone = driver.FindElement(By.Id("ambulanceImage"));
                    imagePresent = true;
                }
                catch {
                    imagePresent = false;
                }
                Assert.IsFalse(imagePresent);

                driver.Quit();
            }
        }
Esempio n. 25
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            var driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;

            var webDriver = new PhantomJSDriver(driverService);

            webDriver.Navigate().GoToUrl("http://www.udebug.com/UVa/10812");
            IWebElement inputBox = webDriver.FindElement(By.Id("edit-input-data"));

            inputBox.SendKeys("3\n2035415231 1462621774\n1545574401 1640829072\n2057229440 1467906174");
            IWebElement submitButton = webDriver.FindElement(By.Id("edit-output"));

            submitButton.Click();
            string answer = webDriver.PageSource;
            int    begin  = answer.IndexOf("<pre>") + 5;

            answer = answer.Substring(begin, answer.IndexOf("</pre>") - begin);
            webDriver.Close();
            MessageBox.Show(answer);
        }
Esempio n. 26
0
        public static ParsedSongInfo ParseVideoPage(String id)
        {
            IWebDriver ffDriver      = new FirefoxDriver();
            var        driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;

            var options = new PhantomJSOptions();

            options.AddAdditionalCapability("phantomjs.page.settings.userAgent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36");

            var phantom = new PhantomJSDriver(driverService, options);

            phantom.Navigate().GoToUrl($"http://v.redonapp.com/yt/{id}");

            String Title = phantom.FindElement(By.Id("result_title")).Text;
            String Uri   = phantom.FindElement(By.Id($"o_{id}")).GetAttribute("rel");

            ParsedSongInfo info = new ParsedSongInfo(Uri, Title);

            return(info);
        }
Esempio n. 27
0
        static void Main(string[] args)
        {
            string rootfilename   = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            string filename       = rootfilename + "\\output.csv";
            int    invalidCounter = 0;

            Console.WriteLine("Enter desired number of attempts (ex. 200):" + Environment.NewLine);
            var attemptsCount = Console.ReadLine();

            Console.WriteLine("Running through " + attemptsCount.ToString() + " iterations, now select your desired prodcut...." + Environment.NewLine + " (1) ReadyNAS RNDP6000" + " (2) ReadyNAS 516" + " (3) ReadyNAS 716X" + " (4) R8000 Router" + " (5) R8500 Router" + " (6) A6210 WiFi USB Adapter" + " (7) ProSAFE M7300-24XF Switch" + " (8) ReadyNAS 526X" + " (9) ReadyNAS 528X" + " (10) R9000 Router" + " (11) ProSAFE XS728T Switch" + " (12) ProSAFE XS748T Switch MSRP 3,000$" + Environment.NewLine);
            var productChoice = Console.ReadLine();

            //Using PhamtomJS for autoamtion
            IWebDriver driver = new PhantomJSDriver(@"C:\PhantomJs\bin\phantomjs\bin\");

            StringBuilder validserials = new StringBuilder();

            for (int i = 0; i < Convert.ToInt32(attemptsCount); i++)
            {
                driver.Navigate().GoToUrl("https://my.netgear.com/register/register.aspx");
                string tempSerial = GenerateSerial(productChoice);
                driver.FindElement(By.Id("ContentPlaceHolder1_txtSerial")).SendKeys(tempSerial);
                driver.FindElement(By.Id("ContentPlaceHolder1_ddlMonth")).Click();

                //Wait a bit just in case the js refresh takes awhile
                System.Threading.Thread.Sleep(5000);
                try
                {
                    string sertype = driver.FindElement(By.Id("ContentPlaceHolder1_lblProductName")).Text;
                    validserials.AppendLine(sertype + "," + tempSerial);
                }
                catch (NoSuchElementException)
                {
                    invalidCounter++;
                }
            }
            Console.WriteLine("We found " + invalidCounter.ToString() + " invalid serials out of the total attempt count of " + attemptsCount.ToString());
        }
Esempio n. 28
0
        public IWebElement PhFind(PhantomJSDriver browser, By by)
        {
            var _wait = new WebDriverWait(browser, TimeSpan.FromSeconds(120));

            try
            {
                var result = _wait.Until(x => x.FindElements(by).FirstOrDefault() != null);
            }
            catch
            {
            }

            return(browser.FindElement(by));
        }
Esempio n. 29
0
        private void InitPhantom(string login, string password)
        {
            var service = PhantomJSDriverService.CreateDefaultService();

            service.IgnoreSslErrors = true;
            service.LoadImages      = false;
            service.ProxyType       = "none";
            service.SslProtocol     = "any";

            var options = new PhantomJSOptions();

            options.AddAdditionalCapability("phantomjs.page.settings.userAgent", _phantomJsUserAgent);

            _phantom = new PhantomJSDriver(service, options);
            _phantom.Navigate().GoToUrl($"{BaseUrl}/accounts/login");


            _phantom.FindElement(By.Id("input_login_email")).SendKeys(login);
            _phantom.FindElement(By.Id("input_login_password")).SendKeys(password);
            _phantom.FindElement(By.Id("signin_submit")).Click();
            new WebDriverWait(_phantom, TimeSpan.FromSeconds(10)).Until(
                ExpectedConditions.UrlContains($"{BaseUrl}/app/"));
        }
Esempio n. 30
0
        public void ChildFormSubmitTest()
        {
            using (IWebDriver driver = new PhantomJSDriver())
            {
                driver.Navigate().GoToUrl("http://localhost:60123/");
                IWebElement parentStartAction = driver.FindElement(By.Name("parent_start"));
                parentStartAction.Click();

                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
                wait.Until(d => d.Title.StartsWith("ParentStart", StringComparison.OrdinalIgnoreCase));

                using (var child = new ChildIFrame(driver))
                {
                    const string testMessage = "Beate";
                    var          inputField  = child.GetFirstNameField();
                    inputField.SendKeys(testMessage);
                    var submitButton = child.GetSubmitButton();
                    submitButton.Click();

                    var resultField = child.GetResultField();
                    Assert.AreEqual(testMessage, resultField.GetAttribute("value"));
                }

                const string parentTestMessage  = "parentMessage";
                IWebElement  parentAnotherField = driver.FindElement(By.Name("parent_another_field"));
                parentAnotherField.SendKeys(parentTestMessage);
                Assert.AreEqual(parentTestMessage, parentAnotherField.GetAttribute("value"));

                using (var child = new ChildIFrame(driver))
                {
                    const string testMessage = "fill those out as well";
                    var          inputField  = child.GetInputField();
                    inputField.SendKeys(testMessage);
                    Assert.AreEqual(testMessage, inputField.GetAttribute("value"));
                }
            }
        }