Welcome Guest Search | Active Topics | Sign In | Register

How to browse a webpage(Page by Page) using webcontrol in vb.net Options
venkaat
Posted: Monday, March 9, 2015 7:53:24 AM
Rank: Newbie
Groups: Member

Joined: 3/9/2015
Posts: 1
Through Windows app i want to login into website using webcontrol automatically and i need to search and browse the web pages .. here is my eg:

In load event

Quote:
Dim webAddress As String = "http:XXXXXXXx"
' WebControl2.WebView.Url = webAddress
WebControl2.WebView.LoadUrlAndWait(webAddress)
WebControl2.WebView.EvalScript("document.getElementsByName('username')[0].value = 'xxxxxx';")
WebControl2.WebView.EvalScript("document.getElementsByName('password')[0].value = 'yyyyy';")
WebControl2.WebView.EvalScript("document.getElementsByName('username')[0].focus();")
WebControl2.WebView.EvalScript("document.getElementsByName('password')[0].focus();")
WebControl2.WebView.SetFocus()

SendKeys.Send("{TAB}")
SendKeys.Send(ControlChars.Cr)

it works fine but i could't access the page which i have loged in,
i have to download a link from the redirected page, How to do it?
eo_support
Posted: Monday, March 9, 2015 9:04:05 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

The code you have is fine, I do not understand you what you meant by "I couldn't access the page which I have logged in" though. If you can explain in details, we might be able to provide some additional information for you.

Another method to do automatic login is to use LoadRequest. You simply create a Request object, add the post data item, then use LoadRequest to load the request. This is more reliable than SendKeys and Focus since sometimes focus can not be successfully set.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.