-
Oct 23rd, 2012, 07:03 PM
#1
Thread Starter
Addicted Member
Last edited by jalexander; Oct 31st, 2012 at 07:34 PM.
Reason: resolved
dim jenn as geek = true
Learning ~ Visual Basic 2010 ~ in free time between college/work -
currently looking for a 'programming buddy' / 'coder friend' / and or 'mentor'. p.m. me if you
have ANY free time AT ALL I'm like 33% of a novice level ~ willing 2 listen/learn +
i am totally super motivated & promise to make an effffin amazing protege!!! #swag
| -_-_- -_-_- |
...W.T..F!?.....
||| Matter on the atomic/quantum level isn't solid or even matter at all. It can also exist in at least 2 places simultaneously (demonstrated in lab). It's position can only be established when it's actually observed. If we turn our back on it... it goes back to a wave form. History show's that every previous generation (since the beginning of time) got almost everything wrong. Then it might very well stand to reason that up is down & right can be wrong. Admit it.. our combined perception of reality is just that, we know absolutely nothing of actual reality & to think we do is simply subscribing to a "ignorance is bliss" mantra |||
-
Oct 23rd, 2012, 11:46 PM
#2
Thread Starter
Addicted Member
InvokeMember("click") Javascript event
Figured I would mention this is on a normal / html / webpage. On a remote server & I'm using a WebBrowser Control inside a typical windows form (visual basic 2010).
So nothing complicated or anything. Maybe I'm just missing a loop, or am doing one without realizing it?
-
Oct 24th, 2012, 01:13 PM
#3
Addicted Member
Re: InvokeMember("click") Javascript event
Hi Jalexander
Funnily enough im working on a similar project with HTML elements and all that jazz.
if for the whole 'for each' loop you only intend to pick one person out, you could always put in an 'end for' after invoking the click. also one thing that i have had problems with is the page not loading quick enough to sort this i have had to do this
Code:
while wb.readystate <> readystate.complete
application.doevents()
end while
and this
System.Threading.Thread.Sleep(5000) ' this just to slow things down a bit
Ian
Last edited by 12many; Oct 24th, 2012 at 01:14 PM.
Reason: poor grammer
-
Oct 24th, 2012, 01:21 PM
#4
Hyperactive Member
Re: InvokeMember("click") Javascript event (too fast for my website) Help Me Fixit? :
Code:
Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
End Sub
Or you could use the DocumentCompleted event?
Maybe I'm just missing a loop, or am doing one without realizing it?
For..Each..Next, that is a loop. So the answer to your question is yes, you are having it loop through each 'h'.
Here is an example of document completed event
vb .net Code:
Private Sub wb_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles wb.DocumentCompleted
If LoggedIn = False Then
Login(wb)
Else
If InMainArea = False Then
EnterMainArea(wb)
End IF
End If
End Sub
Last edited by thebuffalo; Oct 24th, 2012 at 01:26 PM.
-
Oct 24th, 2012, 02:14 PM
#5
Re: InvokeMember("click") Javascript event (too fast for my website) Help Me Fixit? :
Faith in the DocumentCompleted event is often misplaced. It will fire several times on the average webpage, and many times on some. You still need to check that the content you want to interact with is amongst the items that have fully loaded and ensure that you don't trip the relevant action if there are further firings on the current page.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Oct 24th, 2012, 02:55 PM
#6
Hyperactive Member
Re: InvokeMember("click") Javascript event (too fast for my website) Help Me Fixit? :
Originally Posted by dunfiddlin
Faith in the DocumentCompleted event is often misplaced. It will fire several times on the average webpage, and many times on some. You still need to check that the content you want to interact with is amongst the items that have fully loaded and ensure that you don't trip the relevant action if there are further firings on the current page.
That is why I use the If LoggedIn as a boolean, so once I complete that part it sets it true and continues on to the next If statement. This is only good for certain situations though, mine was to login, go to the main area, then read the page(s).
vb .net Code:
Private Sub wb_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles wb.DocumentCompleted
If LoggedIn = False Then
Login(wb)
Else
If InMainArea = False Then
EnterMainArea(wb)
Else
'Do stuff here
End IF
End If
End Sub
Private Sub Login(ByVal myWB As WebBrowser)
'Do stuff here
LoggedIn = True
End Sub
Private Sub EnterMainArea(ByVal myWB As WebBrowser)
' more stuff
myWB.Document.GetElementById("ctl00_Menus1_hlnkMainTyping").InvokeMember("Click")
InMainArea = True
End Sub
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|