public void Login(Gmail gmail) { try { Init(); string loginUrl = "https://accounts.google.com"; webDriver.Navigate().GoToUrl(loginUrl); // id tab var emailInput = GetElement(webDriver, By.Id("Email"), 2); emailInput.Clear(); emailInput.SendKeys(gmail.ID); Thread.Sleep(500); var nextBtn = GetElement(webDriver, By.Id("next"), 1); nextBtn.Click(); Thread.Sleep(1000); // pass tab var passInput = GetElement(webDriver, By.Id("Passwd"), 1); passInput.Clear(); passInput.SendKeys(gmail.OldPass); Thread.Sleep(500); var signInBtn = GetElement(webDriver, By.Id("signIn"), 1); signInBtn.Click(); Thread.Sleep(1000); } catch (Exception ex) { logger.ErrorFormat("ID: " + gmail.ID + ", {0}, stacktrace: {1}", ex.Message, ex.StackTrace); } }
static void Main(string[] args) { IWebDriver driver = new PhantomJSDriver(); driver.Navigate().GoToUrl("https://www.google.com/#q=site:linkedin.com%2Fin%2F+jhon+tech"); var allLinks = new List <string>(); for (int i = 0; i < 30; i++) { List <string> linksList = ExtractElementsSinglePage(driver); allLinks.AddRange(linksList); var nextUrl = driver.FindElements(By.PartialLinkText("Next")).Last().GetAttribute("href"); driver.Navigate().GoToUrl(nextUrl); } var uniqueUrls = allLinks.Distinct().ToList(); }
public void scrapCinemaName(string googleURL) { IWebDriver driver = new PhantomJSDriver(); var url = googleURL; driver.Navigate().GoToUrl(url); for (int i = 0; i < 5; i++) { //add current page cinemas var cinemasName = scrapOnePageCinema(driver); //add all allCinemas.AddRange(cinemasName); //Go goto next on current page try { var nextUrl = driver.FindElements(By.PartialLinkText("Next")).Last().GetAttribute("href"); driver.Navigate().GoToUrl(nextUrl); } catch (InvalidOperationException e) { //Console.WriteLine(e.Source); } } //close driver driver.Dispose(); }
private PhantomJSDriver GetUrlText(string url) { RandomWait(); driver.Url = url; driver.Navigate(); return(driver); }
public void LoadAnimeList(bool needSynopsis = false) { var width = EpisodesFlowPanel.Width; EpisodesFlowPanel.Controls.Clear(); AnimeSynopsis.Text = CleanSynopsis(AnimeSynopsis.Text); _phantomObject.Navigate().GoToUrl(AnimeUrl); if (needSynopsis) { AnimeSynopsis.Text = CleanSynopsis(_phantomObject.FindElementsByTagName("p")[2].Text); } var myTable = _phantomObject.FindElementsByClassName("episode"); foreach (var node in myTable) { var epcontrol = new EpisodeControl { Text = node.Text.Trim(), Tag = node.GetAttribute("data-value") }; if (StaticsClass.MyAnimeListObject != null) { epcontrol.RateIcon.Click += RateIcon_Click; } else { epcontrol.RateIcon.Visible = false; } EpisodesFlowPanel.Controls.Add(epcontrol); EpisodesFlowPanel.Controls.SetChildIndex(epcontrol, 0); } BringToFront(); }
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(); }
private void LoginButton_Click(object sender, RoutedEventArgs e) { if (User.Text == "" || Password.Password == "") { MessageBox.Show("Insert user and password"); return; } PhantomJSDriverService srv = PhantomJSDriverService.CreateDefaultService(); srv.SuppressInitialDiagnosticInformation = true; srv.HideCommandPromptWindow = true; using (PhantomJSDriver chrDriver = new PhantomJSDriver(srv)) { try { chrDriver.Manage().Window.Minimize(); } catch (Exception ex) { //Evbb } chrDriver.Url = "https://idp.polito.it/idp/x509mixed-login"; chrDriver.Navigate(); IWebElement element = chrDriver.FindElementById("j_username"); element.SendKeys(User.Text); element = chrDriver.FindElementById("j_password"); element.SendKeys(Password.Password); element = chrDriver.FindElementsByTagName("button").Where((x) => { try { x.FindElement(By.Id("usernamepassword")); return(true); } catch (Exception ex) { return(false); } }).First(); element.Click(); chrDriver.Url = "https://didattica.polito.it/portal/page/portal/home/Studente"; chrDriver.Navigate(); if (chrDriver.Manage().Cookies.GetCookieNamed("ShibCookie") != null) { chrDriver.Manage().Cookies.AllCookies.ToList() .ForEach(x => jar.Add(new System.Net.Cookie(x.Name, x.Value, x.Path, x.Domain))); this.DialogResult = true; } else { jar = null; this.DialogResult = false; } this.Close(); } }
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="Content-Type" content="text/html; charset=utf-8"></meta><style id="DS3Style" type="text/css">@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="fix"><table id="area2Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="600" class="device-width header-logo" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 0; border: none;"><p style="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;" align="left">New message: Hi Kobo,As a buyer, I am interest...</p></td></tr></table></td></tr></table> <table id="area3Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse:collapse !important;border-spacing:0 !important;border:none;background-color:#f9f9f9;"><tr><td width="100%" valign="top" style="border-collapse:collapse !important;border-spacing:0 !important;border:none;"><table width="100%" height="7" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url('http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png'); background-repeat: repeat-y no-repeat; margin: 0; padding: 0"><!--[if gte mso 9]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;height:1px;"><v:fill type="tile" color="#dddddd" /></v:rect><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;height:6px;"><v:fill type="tile" src="http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png" color="#f9f9f9" /><div style="width:0px; height:0px; overflow:hidden; display:none; visibility:hidden; mso-hide:all;"><![endif]--><tr><td width="100%" height="1" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd; font-size: 1px; line-height: 1px;"><!--[if gte mso 15]>&nbsp;<![endif]--></td></tr><tr><td width="100%" height="6" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none; font-size: 1px; line-height: 1px;">&nbsp;</td></tr><!--[if gte mso 9]></div></v:rect><![endif]--></table></td></tr></table> <table id="area4Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="600" class="device-width header-logo" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 15px 0 20px; border: none;"><a href="http://rover.ebay.com/rover/0/e12050.m1831.l3127/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&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" style="text-decoration: none; color: #0654ba;"><img src="http://p.ebaystatic.com/aw/logos/header_ebay_logo_132x46.gif" width="132" height="46" border="0" alt="eBay" align="left" style="display: inline block; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: none;" /></a><img src="http://rover.ebay.com/roveropen/0/e12050/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd" alt="" style="border:0; height:1;"/></td></tr></table></td></tr></table> <table id="area5Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; background-color:#f9f9f9"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table id="PrimaryMessage" width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <tr><td valign="top" class="secondary-headline" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 20px 0 5px;"><h1 style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 15px; color: #808284; text-align: left; font-size: 13px; margin: 0 0 4px;" align="left">New message from:<a href="http://rover.ebay.com/rover/0/e12050.m44.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&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" style="text-decoration: none; font-weight: bold; color: #336fb7;">andfen6</a><a href="http://rover.ebay.com/rover/0/e12050.m44.l1183/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Ffeedback.ebay.ca%2Fws%2FeBayISAPI.dll%3FViewFeedback%26userid%3Dandfen6%26ssPageName%3DSTRK%3AME%3AUFS" style="text-decoration: none; color: #888888;">(5)</a></h1></td></tr> <tr><td valign="top" class="viewing-problem-block" style="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;"> <table width="600" class="device-width" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; border:0; cellpadding:0; cellspacing:0; align:center; bgcolor:#f9f9f9;"> <tr><td width="100%" class="wrapText device-width" valign="top" style="overflow: hidden; border-collapse: collapse !important; border-spacing: 0 !important; border: none; display: inline-block; max-width:600px;"><h3 style="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;" align="left"><div id="UserInputtedText">Hi Kobo,<br /><br />As a buyer, I am interested....<br /><br />this is a test message</div></h3> <span style="color:#666666"></span> </td></tr> <tr><td valign="top" width="15" height="15" style="border-collapse: collapse !important; border-spacing: 20 !important; border: none;"></td></tr> <tr><td valign="top" class="cta-block" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 5px 0 5px; border: none;"><table align="left" cellpadding="0" cellspacing="0" border="0" class="mobile-full-width" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="center cta-button primary-cta-button" align="center" style="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='#0079bc', endColorstr='#00519e',GradientType=0 ); background-image: linear-gradient(to bottom, #0079bc 0%,#00519e 100%); background-color: #0079bc; padding: 10px 17px; border: 1px solid #00519e;" bgcolor="#0079bc"><a href="http://rover.ebay.com/rover/0/e12050.m44.l1139/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fcontact.ebay.ca%2Fws%2FeBayISAPI.dll%3FM2MContact%26requested%3Dandfen6%26qid%3D1291497258010%26redirect%3D0" style="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;"><span style="padding: 0px 10px">Reply</span></a></td></tr></table> </td></tr> </table></td></tr></table> <!--[if !mso]><!--><div id="V4PrimaryMessage" style="max-height: 0px; font-size: 0; overflow:hidden; display: none !important;"><div><table border="0" cellpadding="2" cellspacing="3" width="100%"><tr><td><font style="font-size:10pt; font-family:arial, sans-serif; color:#000"><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="font-weight:bold; font-size:10pt; font-family:arial, sans-serif; color:#000">- andfen6</div></td><td valign="top" width="185"><div></div></td></tr></table></div></div><!--<![endif]--> </td> </tr></table> <table id="area3Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="100%" height="7" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url(&#39;http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png&#39;); background-repeat: repeat-y no-repeat; margin: 0; padding: 0"> <tr><td width="100%" height="1" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd;"></td></tr> <tr><td width="100%" height="6" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none;"></td></tr></table> </td> </tr> </table> <table id="area7Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9;"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <tr><td valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; padding-right:20px;"><h1 style="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;" align="left">Get to know <a href="http://rover.ebay.com/rover/0/e12050.m3965.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&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" style="text-decoration: none; color: #336fb7;">andfen6</a> </h1><table style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; text-align: left; font-size: 14px; margin-bottom: 10px; padding-bottom: 10px;" align="left"><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Located: Toronto, ON, Canada</td></tr><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Member since: Dec 17, 2015</td></tr><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Positive Feedback: 100%</td></tr></table></td></tr></table></td></tr></table> <table id="area10Container" class="whiteSection" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="viewing-problem-block" style="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;"><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="center">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="area11Container" class="whiteSection" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="ebay-footer-block" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 40px 0 60px; border: none;"> <div id="ReferenceId"><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left"><strong>Email reference id: [#a05-c1pifaockd#]_[#68fe0bd048d04a84b6d8ef4046dde4cd#]</strong></p></div><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">We don't check this mailbox, so please don't reply to this message. If you have a question, go to <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l6369/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Focsnext.ebay.ca%2Focs%2Fhome" target="_blank">Help & Contact</a>.</p> <p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">eBay sent this message to Nantha Gopalasamy (rakutenkobo). Learn more about <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3167/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Faccount%2Fprotecting-account.html" target="_blank">account protection</a>. eBay is committed to your privacy. Learn more about our <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3168/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fprivacy-policy.html" target="_blank">privacy policy</a> and <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3165/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fuser-agreement.html" target="_blank">user agreement</a>.</p><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">&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="Content-Type" content="text/html; charset=utf-8"></meta><style id="DS3Style" type="text/css">@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="fix"><table id="area2Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="600" class="device-width header-logo" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 0; border: none;"><p style="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;" align="left">New message: Hi Kobo,As a buyer, I am interest...</p></td></tr></table></td></tr></table> <table id="area3Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse:collapse !important;border-spacing:0 !important;border:none;background-color:#f9f9f9;"><tr><td width="100%" valign="top" style="border-collapse:collapse !important;border-spacing:0 !important;border:none;"><table width="100%" height="7" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url('http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png'); background-repeat: repeat-y no-repeat; margin: 0; padding: 0"><!--[if gte mso 9]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;height:1px;"><v:fill type="tile" color="#dddddd" /></v:rect><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;height:6px;"><v:fill type="tile" src="http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png" color="#f9f9f9" /><div style="width:0px; height:0px; overflow:hidden; display:none; visibility:hidden; mso-hide:all;"><![endif]--><tr><td width="100%" height="1" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd; font-size: 1px; line-height: 1px;"><!--[if gte mso 15]>&nbsp;<![endif]--></td></tr><tr><td width="100%" height="6" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none; font-size: 1px; line-height: 1px;">&nbsp;</td></tr><!--[if gte mso 9]></div></v:rect><![endif]--></table></td></tr></table> <table id="area4Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="600" class="device-width header-logo" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 15px 0 20px; border: none;"><a href="http://rover.ebay.com/rover/0/e12050.m1831.l3127/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&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" style="text-decoration: none; color: #0654ba;"><img src="http://p.ebaystatic.com/aw/logos/header_ebay_logo_132x46.gif" width="132" height="46" border="0" alt="eBay" align="left" style="display: inline block; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: none;" /></a><img src="http://rover.ebay.com/roveropen/0/e12050/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd" alt="" style="border:0; height:1;"/></td></tr></table></td></tr></table> <table id="area5Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; background-color:#f9f9f9"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table id="PrimaryMessage" width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <tr><td valign="top" class="secondary-headline" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 20px 0 5px;"><h1 style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 15px; color: #808284; text-align: left; font-size: 13px; margin: 0 0 4px;" align="left">New message from:<a href="http://rover.ebay.com/rover/0/e12050.m44.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&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" style="text-decoration: none; font-weight: bold; color: #336fb7;">andfen6</a><a href="http://rover.ebay.com/rover/0/e12050.m44.l1183/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Ffeedback.ebay.ca%2Fws%2FeBayISAPI.dll%3FViewFeedback%26userid%3Dandfen6%26ssPageName%3DSTRK%3AME%3AUFS" style="text-decoration: none; color: #888888;">(5)</a></h1></td></tr> <tr><td valign="top" class="viewing-problem-block" style="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;"> <table width="600" class="device-width" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; border:0; cellpadding:0; cellspacing:0; align:center; bgcolor:#f9f9f9;"> <tr><td width="100%" class="wrapText device-width" valign="top" style="overflow: hidden; border-collapse: collapse !important; border-spacing: 0 !important; border: none; display: inline-block; max-width:600px;"><h3 style="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;" align="left"><div id="UserInputtedText">Hi Kobo,<br /><br />As a buyer, I am interested....<br /><br />this is a test message</div></h3> <span style="color:#666666"></span> </td></tr> <tr><td valign="top" width="15" height="15" style="border-collapse: collapse !important; border-spacing: 20 !important; border: none;"></td></tr> <tr><td valign="top" class="cta-block" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 5px 0 5px; border: none;"><table align="left" cellpadding="0" cellspacing="0" border="0" class="mobile-full-width" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="center cta-button primary-cta-button" align="center" style="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='#0079bc', endColorstr='#00519e',GradientType=0 ); background-image: linear-gradient(to bottom, #0079bc 0%,#00519e 100%); background-color: #0079bc; padding: 10px 17px; border: 1px solid #00519e;" bgcolor="#0079bc"><a href="http://rover.ebay.com/rover/0/e12050.m44.l1139/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fcontact.ebay.ca%2Fws%2FeBayISAPI.dll%3FM2MContact%26requested%3Dandfen6%26qid%3D1291497258010%26redirect%3D0" style="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;"><span style="padding: 0px 10px">Reply</span></a></td></tr></table> </td></tr> </table></td></tr></table> <!--[if !mso]><!--><div id="V4PrimaryMessage" style="max-height: 0px; font-size: 0; overflow:hidden; display: none !important;"><div><table border="0" cellpadding="2" cellspacing="3" width="100%"><tr><td><font style="font-size:10pt; font-family:arial, sans-serif; color:#000"><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="font-weight:bold; font-size:10pt; font-family:arial, sans-serif; color:#000">- andfen6</div></td><td valign="top" width="185"><div></div></td></tr></table></div></div><!--<![endif]--> </td> </tr></table> <table id="area3Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="100%" height="7" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url(&#39;http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png&#39;); background-repeat: repeat-y no-repeat; margin: 0; padding: 0"> <tr><td width="100%" height="1" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd;"></td></tr> <tr><td width="100%" height="6" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none;"></td></tr></table> </td> </tr> </table> <table id="area7Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9;"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <tr><td valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; padding-right:20px;"><h1 style="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;" align="left">Get to know <a href="http://rover.ebay.com/rover/0/e12050.m3965.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&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" style="text-decoration: none; color: #336fb7;">andfen6</a> </h1><table style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; text-align: left; font-size: 14px; margin-bottom: 10px; padding-bottom: 10px;" align="left"><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Located: Toronto, ON, Canada</td></tr><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Member since: Dec 17, 2015</td></tr><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Positive Feedback: 100%</td></tr></table></td></tr></table></td></tr></table> <table id="area10Container" class="whiteSection" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="viewing-problem-block" style="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;"><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="center">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="area11Container" class="whiteSection" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="ebay-footer-block" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 40px 0 60px; border: none;"> <div id="ReferenceId"><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left"><strong>Email reference id: [#a05-c1pifaockd#]_[#68fe0bd048d04a84b6d8ef4046dde4cd#]</strong></p></div><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">We don't check this mailbox, so please don't reply to this message. If you have a question, go to <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l6369/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Focsnext.ebay.ca%2Focs%2Fhome" target="_blank">Help & Contact</a>.</p> <p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">eBay sent this message to Nantha Gopalasamy (rakutenkobo). Learn more about <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3167/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Faccount%2Fprotecting-account.html" target="_blank">account protection</a>. eBay is committed to your privacy. Learn more about our <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3168/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fprivacy-policy.html" target="_blank">privacy policy</a> and <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3165/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fuser-agreement.html" target="_blank">user agreement</a>.</p><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">&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(); }
public bool Login() { PhantomJsDriver.Navigate().GoToUrl($"{BaseUrl}{LoginUrl}"); PhantomJsDriver.FindElementById("ctl00_MainContent_InputLogin").SendKeys(_username); PhantomJsDriver.FindElementById("ctl00_MainContent_InputPassword").SendKeys(_password); PhantomJsDriver.FindElementById("ctl00_MainContent_btnLogin").Click(); PhantomJsDriver.WaitForAjax(); return(PhantomJsDriver.Url != $"{BaseUrl}{LoginUrl}"); }
private ReadOnlyCollection <IWebElement> GetMatchesList(string url) { ReadOnlyCollection <IWebElement> matchesNotStarted = null; JSDriver.Url = url; JSDriver.Navigate(); string content = JSDriver.PageSource; matchesNotStarted = JSDriver.FindElementsByClassName("stage-scheduled"); // only get matches that already started return(matchesNotStarted); }
void pullData(string inputURL, string sportName) { Console.WriteLine("Starting Pull of " + inputURL); PhantomJSDriverService service = PhantomJSDriverService.CreateDefaultService("..\\..\\packages\\PhantomJS.2.1.1\\tools\\phantomjs"); service.IgnoreSslErrors = true; service.SslProtocol = "any"; service.LocalToRemoteUrlAccess = true; //service.AddArgument("--ignore-ssl-errors=true"); // service.AddArgument("--ssl-protocol=tlsv1"); //service.GhostDriverPath = "E:\\SportsBetting\\packages\\PhantomJS.2.1.1\\tools\\phantomjs"; //PhantomJSDriver driver = new PhantomJSDriver("E:\\SportsBetting\\packages\\PhantomJS.2.1.1\\tools\\phantomjs"); PhantomJSDriver driver = new PhantomJSDriver(service); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(20)); //driver.Url = inputURL; string source = ""; try { driver.Navigate().GoToUrl(inputURL); source = driver.PageSource; } catch (Exception e) { Helper.writeError(e.ToString(), (fileName + sportName)); } Helper.writePulledData(source, (fileName + sportName)); driver.Quit(); Console.WriteLine("Data pulled"); }
private IEnumerable <HtmlDocument> GetHtmlDocuments(IEnumerable <string> Urls) { try { _log.Info($"Getting html documents..."); var response = new List <HtmlDocument>(); _log.Info($"Open webdriver element.."); using (var driver = new PhantomJSDriver()) { foreach (var item in Urls) { var sw = Stopwatch.StartNew(); _log.Info($"Getting informations for url : {item}"); driver.Navigate().GoToUrl(item); _log.Info($"Waiting for parametrized ThreadSleep: {ThreadSleepTime}"); Thread.Sleep(ThreadSleepTime); var html = new HtmlDocument(); html.LoadHtml(driver.PageSource); response.Add(html); sw.Stop(); _log.Info($"ElapsedTime: {sw.ElapsedMilliseconds} ms"); } _log.Info($"Closing webdriver element"); driver.Quit(); } return(response); } catch (Exception ex) { throw ex; } }
/// <summary> /// Método responsável por retornar os funcionarios da empresa selecionada /// </summary> /// <param name="poPhantom">Objeto phantomjsdriver</param> /// <param name="pstrCode">Codigo da empresa</param> /// <returns></returns> public static List <LinkedinUser> GetPeoples(PhantomJSDriver poPhantom, string pstrCode) { var pageCount = 5; var loModel = new List <LinkedinUser>(); var url = $"https://www.linkedin.com/search/results/people/?facetCurrentCompany=%5B\"{pstrCode}\"%5D"; for (int lintCont = 1; lintCont <= pageCount; lintCont++) { poPhantom.Navigate().GoToUrl($"{url}&page={lintCont}"); var users = poPhantom.FindElementsByClassName("search-result__wrapper"); for (int lintCont2 = 0; lintCont2 < users.Count; lintCont2++) { var model = new LinkedinUser(); model.Name = users[lintCont2].FindElement(By.ClassName("actor-name")).Text; model.Foto = users[lintCont2].FindElement(By.TagName("img")).GetAttribute("src"); model.Cargo = users[lintCont2].FindElement(By.ClassName("subline-level-1")).Text; model.Link = users[lintCont2].FindElement(By.ClassName("search-result__result-link")).GetAttribute("href"); loModel.Add(model); } } return(loModel); }
public void TestPhantomJs() { IWebDriver driver = null; try { PhantomJSOptions options = new PhantomJSOptions(); driver = new PhantomJSDriver(); driver.Url = "http://www.softpost.org"; driver.Manage().Window.Maximize(); Console.WriteLine("Title is " + driver.Title); driver.Navigate(); } catch (Exception e) { Console.WriteLine("Exception ....*********" + e.ToString()); } finally { Thread.Sleep(2000); driver.Close(); driver.Quit(); } }
static void Main(string[] args) { using (var driver = new PhantomJSDriver()) { driver.Manage().Window.Maximize(); var saveDir = $"SaveImgs/"; StringBuilder builder = new StringBuilder(); foreach (var item in pagesConfig) { try { Console.WriteLine($"开始前往{item.Key}首页:{item.Value}"); if (!Directory.Exists(saveDir)) { Directory.CreateDirectory(saveDir); } driver.Navigate().GoToUrl(item.Value); var saveName = $"{item.Key}.jpg"; var savePath = $"{ saveDir }/{ saveName}"; ((ITakesScreenshot)driver).GetScreenshot().SaveAsFile(savePath, ScreenshotImageFormat.Jpeg); builder.AppendLine($"### {item.Key}"); builder.AppendLine($"![图片](./{saveName})"); Console.WriteLine($"图片保存至:{savePath}"); } catch (Exception ex) { Console.WriteLine(item.Key + "" + ex.Message); } } //创建MD文件 Utils.FileHelper.WriteFile(builder.ToString(), $"{saveDir}/README.MD"); driver.Quit(); } }
/// <summary> /// Start PhantomJS on aiondatabase website. /// </summary> public static void PhantomStart() { try { DriverService = PhantomJSDriverService.CreateDefaultService(); DriverService.HideCommandPromptWindow = true; Driver = new PhantomJSDriver(DriverService); Driver.Url = "http://aiondatabase.net/en/"; Driver.Navigate(); } catch (Exception e) { switch (e.Message) { case "The path is not of a legal form.": Console.WriteLine("\nMissing WebDriver.dll\n"); Console.ReadKey(); Environment.Exit(-1); break; default: Main(); break; } } }
/// <summary> /// REFERENCES: /// other approach: /// /// http://stackoverflow.com/questions/18921099/add-proxy-to-phantomjsdriver-selenium-c /// PhantomJSOptions phoptions = new PhantomJSOptions(); /// phoptions.AddAdditionalCapability(CapabilityType.Proxy, "http://localhost:9999"); /// /// driver = new PhantomJSDriver(phoptions); /// - (24/04/2019) https://stackoverflow.com/a/52446115/3796898 /// /// </summary> /// <param name="hostPgUrlPattern"></param> /// <param name="freeProxy"></param> /// <returns></returns> public static string LoadIPProxyDocumentContent(string hostPgUrlPattern, IPProxy freeProxy = null) { //var options = new ChromeOptions(); //var userAgent = "user_agent_string"; //options.AddArgument("--user-agent=" + userAgent); //IWebDriver driver = new ChromeDriver(options); var service = PhantomJSDriverService.CreateDefaultService(".\\"); service.HideCommandPromptWindow = true; if (freeProxy != null) { service.ProxyType = freeProxy.Protocol == ProxyProtocolsEnum.HTTP ? "http" : "https:"; var proxy = new Proxy { HttpProxy = $"{freeProxy.IPAddress}:{freeProxy.PortNo}", }; service.Proxy = proxy.HttpProxy; } var driver = new PhantomJSDriver(service) { Url = hostPgUrlPattern }; driver.Navigate(); var content = driver.PageSource; driver.Quit(); return(content); }
public ActionResult Index(SearchRequest req) { var list = new List <Item>(); try { var driver = new PhantomJSDriver(); driver.Navigate().GoToUrl($"https://www.google.se/#q={req.Query}"); var elements = driver.FindElementsByClassName("g"); foreach (var element in elements) { var link = element.FindElement(By.TagName("a")).GetAttribute("href"); var header = element.FindElement(By.TagName("h3")).Text; list.Add(new Item { Header = header, Url = link }); } } catch (Exception e) { } return(this.Json(new Result { Query = req.Query, Items = list.ToArray() }, JsonRequestBehavior.AllowGet)); }
private void read_elements(string url) { //var driver = new ChromeDriver(); //TimeSpan timer = TimeSpan.FromSeconds(10); //driver.Manage().Timeouts().PageLoad = timer; //driver.Navigate().GoToUrl(url); PhantomJSDriver phantom = new PhantomJSDriver(); phantom.Navigate().GoToUrl(url); //System.Threading.Thread.Sleep(2000); HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); //doc.LoadHtml(driver.PageSource); doc.LoadHtml(phantom.PageSource); while (doc.DocumentNode.SelectNodes("//*[@id=\"container\"]/channel/div/div/div") == null) { doc.LoadHtml(phantom.PageSource); } phantom.Quit(); string dank = doc.DocumentNode.SelectNodes("//*[@id=\"container\"]/channel/div/div/div")[0].OuterHtml; string danki = Regex.Replace(dank, ".*background-image", "", RegexOptions.Singleline); //string danker = danki.Substring(0, 200); string dankii = Regex.Replace(danki, "background-color.*", "", RegexOptions.Singleline); string danker = Regex.Replace(dankii, "quot", ""); string why = Regex.Replace(danker, "[();&]", ""); string whyy = Regex.Replace(why, ": url", ""); string whyyy = Regex.Replace(whyy, "\\?type=nf720_342.*", "", RegexOptions.Singleline); string whyyyy = Regex.Replace(whyyy, " ", ""); textBox6.AppendText(whyyy + "\n"); pictureBox1.Load(whyyy + "?type=nf720_342"); }
private void Crawler_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; //最大化窗体 //加载cc域名对应的可用地址 Action <string> setTbx1 = (s) => { textBox1.Text = s; }; Action <string> setTbx2 = (s) => { textBox2.Text = s; }; Action <string> setTbx3 = (s) => { textBox3.Text = s; }; Action <bool> setBtn1 = (s) => { button1.Enabled = s; }; try { Task.Run(() => { var _service = PhantomJSDriverService.CreateDefaultService(); _service.HideCommandPromptWindow = true; var driver = new PhantomJSDriver(_service); driver.Navigate().GoToUrl("http://zc.97down.info"); var domain = driver.Url; var zp = domain + AppSettings.GetValue <string>("ListPageUrl_ZP"); var wm = domain + AppSettings.GetValue <string>("ListPageUrl_WM"); var lc = domain + AppSettings.GetValue <string>("ListPageUrl_LC"); textBox1.Invoke(setTbx1, zp); textBox2.Invoke(setTbx2, wm); textBox3.Invoke(setTbx3, lc); button1.Invoke(setBtn1, true); }); } catch (Exception ee) { MessageBox.Show(ee.Message); } }
/// <summary> /// GetCookiesByUrl /// </summary> /// <param name="url"></param> /// <returns></returns> public static string GetCookiesByUrl(string url) { var userAgent = @"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.108 Safari/537.36 2345Explorer/8.6.2.15784"; var options = new PhantomJSOptions(); options.AddAdditionalCapability(@"phantomjs.page.settings.userAgent", userAgent); using (var driver = new PhantomJSDriver(options)) { var navigation = driver.Navigate(); navigation.GoToUrl(url); var cookies = driver.Manage().Cookies.AllCookies; string cookiesString = ""; bool isFirst = true; foreach (var cookie in cookies) { if (isFirst) { cookiesString += HttpHelper.GetFormatCookies(cookie.ToString()); isFirst = false; } else { cookiesString = $"{cookiesString};{HttpHelper.GetFormatCookies(cookie.ToString())}"; } } Console.WriteLine($"cookies:{cookiesString}"); return(cookiesString); } }
/// <summary> /// 创同步建爬虫 /// </summary> /// <param name="uri">爬虫URL地址</param> /// <param name="proxy">代理服务器</param> /// <returns>网页源代码</returns> public PhantomJSDriver StartSync(Uri uri, Script script, Operation operation) { try { var _service = PhantomJSDriverService.CreateDefaultService(); var _option = new PhantomJSOptions(); var driver = new PhantomJSDriver(_service, _option); var watch = DateTime.Now; driver.Navigate().GoToUrl(uri.ToString()); if (script != null) { ExecuteScript(script, driver); } if (operation != null) { ExecuteAction(operation, driver); } var threadId = System.Threading.Thread.CurrentThread.ManagedThreadId; var milliseconds = DateTime.Now.Subtract(watch).Milliseconds; //var pageSource = driver.PageSource; return(driver); } catch (Exception ex) { throw ex; } }
private void SubmitBtn_Click(object sender, EventArgs e) { if (MainGrpBox.Controls.OfType <CheckBox>().Where(x => x.Checked).Count() != 2) { MessageBox.Show("Select 2 values please.", "Otaku Time"); return; } string values = String.Join(",", MainGrpBox.Controls.OfType <CheckBox>().Where(x => x.Checked).Select(x => x.Tag)); _Driver.ExecuteScript($"document.getElementById('answerCap').setAttribute('value','{values}')"); _Driver.FindElementById("formVerify").Submit(); if (_Driver.Title == "http://kissanime.ru/Special/AreYouHuman2") //user is wrong. So much for user interaction. { //restart the process. foreach (CheckBox Chk in MainGrpBox.Controls.Cast <CheckBox>()) { Chk.Checked = false; } _Driver.Navigate().GoToUrl(_Url); RenderScreen(); } else { DialogResult = DialogResult.OK; Close(); } }
static void Main(string[] args) { var urls = new List <string>(); PhantomJSDriver driver = new PhantomJSDriver(); driver.Navigate().GoToUrl(link); for (int i = 1; i < 9; i++) { var pages = driver.FindElements(By.ClassName("pages")); HtmlDocument document = new HtmlDocument(); document.LoadHtml(driver.PageSource); var cars = document.DocumentNode.SelectNodes(".//div[@class='vehicle-title clearfix']"); foreach (var car in cars) { var carDetail = car.SelectSingleNode(".//a"); var url = carDetail.GetAttributeValue("href", ""); if (!urls.Contains(url)) { urls.Add(url); } } if (i == 8) { break; } pages.ElementAt(i).Click(); Thread.Sleep(1000); } Console.ReadKey(); }
private System.Net.Cookie SetUpPhantomJS(string link) { System.Net.Cookie cookie = new System.Net.Cookie(); // PhantomJS seems to only work with .NET 4.5 or below. PhantomJSOptions options = new PhantomJSOptions(); options.AddAdditionalCapability("IsJavaScriptEnabled", true); PhantomJSDriver driver = new PhantomJSDriver(options); // https://stackoverflow.com/questions/46666084/how-to-deal-with-javascript-when-fetching-http-response-in-c-sharp-using-httpweb // https://riptutorial.com/phantomjs driver.Url = link; driver.Navigate(); var cookies = driver.Manage().Cookies.AllCookies; foreach (var c in cookies) { if (c.Name.Equals("TSPD_101")) { cookie.Name = c.Name; cookie.Domain = c.Domain; cookie.Value = c.Value; cookie.Path = c.Path; cookie.Expires = DateTime.Now.AddHours(6); } } driver.Close(); driver.Dispose(); return(cookie); }
public IWebDriver Create(string url) { lock (this) { var driverService = PhantomJSDriverService.CreateDefaultService(); if (portCache.Contains(driverService.Port)) { driverService.Port = portCache.Max() + 1; } else { portCache.Add(driverService.Port); } driverService.HideCommandPromptWindow = true; try { var driver = new PhantomJSDriver(driverService); driver.Manage().Timeouts().PageLoad = new TimeSpan((long)120E7); driver.Navigate().GoToUrl(url); return(driver); } catch (Exception exc) { Console.WriteLine("err when navigate to : "); Console.WriteLine(exc.Message); } } return(null); }
private static async Task ProductDetails(string url, int parentId) { var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; var driver = new PhantomJSDriver(driverService) { Url = url }; driver.Navigate(); var source = driver.PageSource; //var httpClient = new HttpClient(); // HtmlAgilityPack var htmlDocument = new HtmlDocument(); //var html = await httpClient.GetStringAsync("https:" + url); // HtmlAgilityPack htmlDocument.LoadHtml(source); //var httpClient = new HttpClient(); // HtmlAgilityPack //var htmlDocument = new HtmlDocument(); // HtmlAgilityPack //var html = await httpClient.GetStringAsync(url); // HtmlAgilityPack //htmlDocument.LoadHtml(html); // HtmlAgilityPack var currentImage = htmlDocument.DocumentNode.Descendants("img").FirstOrDefault(node => node.GetAttributeValue("class", "").Equals("pdp-mod-common-image gallery-preview-panel__image"))?.ChildAttributes("src").FirstOrDefault()?.Value; var currentName = htmlDocument.DocumentNode.Descendants("span").FirstOrDefault(node => node.GetAttributeValue("class", "").Equals("pdp-mod-product-badge-title"))?.InnerText.Trim(); var currentPrice = htmlDocument.DocumentNode.Descendants("span").FirstOrDefault(node => node.GetAttributeValue("class", "").Contains("pdp-price"))?.InnerText.Trim(); //var currentSale = htmlDocument.DocumentNode.Descendants("span").FirstOrDefault(node => node.GetAttributeValue("id", "").Equals("span-discount-percent"))?.InnerText.Trim(); //var currentRegularPrice = htmlDocument.DocumentNode.Descendants("span").FirstOrDefault(node => node.GetAttributeValue("class", "").Equals("span-list-price"))?.InnerText.Trim(); var currentSeller = htmlDocument.DocumentNode.Descendants("a").FirstOrDefault(node => node.GetAttributeValue("class", "").Contains("seller-name__detail-name"))?.InnerText.Trim(); // Lưu DB // // End Lưu DB Console.WriteLine("Add ProductName: " + currentName); }
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); } } }
public static string GetPageContent(string url) { _driver.Url = url; _driver.Navigate(); return(_driver.PageSource); }
public IWebDriver Create(string url, Cookie cookie = null) { driverService.HideCommandPromptWindow = true; try { var driver = new PhantomJSDriver(driverService); try { if (cookie != null) { driver.Manage().Cookies.AddCookie(cookie); } } catch (Exception exc) { } driver.Manage().Timeouts().SetPageLoadTimeout(new TimeSpan((long)120E7)); driver.Navigate().GoToUrl(url); return(driver); } catch (Exception exc) { Console.WriteLine("err when navigate to : "); Console.WriteLine(exc.Message); } return(null); }