Expand|Select|Wrap|Line Numbers
- private void GetHtmlCode()
- {
- string uri = GetTargetURI();
- if(!string.IsNullOrEmpty(uri))
- {
- IE ie = IE.AttachTo<IE>(Find.ByUrl(uri));
- htmlCode = ie.Eval(JavaScriptToRun);
- }
- else
- {
- MessageBox.Show("Target page is not opened",
- "Notification", MessageBoxButtons.OK);
- }
- }
Expand|Select|Wrap|Line Numbers
- private string GetTargetURI() //проверка URL
- {
- Regex reg;
- Match match;
- foreach(SHDocVw.InternetExplorer ie in shellWindows)
- {
- reg = new Regex(patternURL);
- match = reg.Match(ie.LocationURL.ToString());
- if (!string.IsNullOrEmpty(match.Value))
- {
- pageURL = ie.LocationURL.ToString();
- return pageURL;
- }
- pageURL = string.Empty;
- }
- return pageURL;
- }
The problem is
Expand|Select|Wrap|Line Numbers
- IE ie = IE.AttachTo<IE>(Find.ByUrl(uri));
Expand|Select|Wrap|Line Numbers
- WatiN.Core.Exceptions.BrowserNotFoundException: Could not find an IE window matching constraint: Attribute 'href' equals uri '%my_target_URI%'. Search expired after '30' seconds.
Can anyone help please?
Thanks.