|
Greetings!
I am currently working in an automation to extract data from IE. I have a scenario where two page will be accessed, the first one is the page without username and password on it and the second one is the page with login page to log username and password...
I am currently working on a code where the condition is if the account is logged is as "none" and level as "Administrator", then the page will be accessed and will be directed to the specific url. but when the account is logged in as "none" and level as "Guest", then will be directed to the login page and username and password will be entered.. the problem is the value or the innertext I am extracting has a <br /> between words, how can I set the condition like this?
[HTML]<div id="userid">Account: none <br /> Level: ADMINISTRATOR</div>[/HTML]
[HTML]<div id="userid">Account: none <br /> Level: GUEST</div>[/HTML]
[CODE]If .Document.GetElementById("userid").innertext = "Account: none " & "<br />" & "Level: ADMINISTRATOR" Then
.Navigate linktesturl
Do While .Busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
.Visible = True[/CODE]
....code continues....
I appreciate your feedback. Thank you. :)
|
|
|
|
|
You normally would not use the contents of a web page like this. You normally get the state from some state object, not the contents of the HTML.
|
|
|
|
|
well, due to limited references, this line is the one I use to identify the differences of the page status, (one with no login, and the other one with login).. Anyways, do you have an idea there which should I use in this case instead?... appreaciate your feedback.
|
|
|
|
|
I have no idea since I don't know anything about your application, what type it is (Windows Forms, WPF, ASP.NET, ...), how it's organized, what it's supposed to be doing, ...
|
|
|
|