|
-
Dec 29th, 2010, 01:17 PM
#1
Thread Starter
New Member
InvokeScript update wait
I am writing a script to copy and paste content off a site. The idea is that the page is updated via javascript, the content is copied and pasted and then then the site is updated again.
Unfortunately with the example code below, I only get the first page repeated again and again. I am not sure what the problem is, but I think that there is not enough time for the page to update before the content is copied.
Can anyone suggest a way that will allow the page to update before carrying out the update feature? This seems trickier because of the javascript
Thanks
WebBrowser1.Document.InvokeScript("__doPostBack", New Object() {"dnn$ctr958$CE_ActiveSocial_Contacts$GridView1", "Page$1"})
WebBrowser1.Select()
Application.DoEvents()
SendKeys.Send("^a")
SendKeys.Send("^c")
pString = Clipboard.GetText()
aWrite = New StreamWriter(qString)
aWrite.Write(pString)
aWrite.Flush()
aWrite.Close()
WebBrowser1.Document.InvokeScript("__doPostBack", New Object() {"dnn$ctr958$CE_ActiveSocial_Contacts$GridView1", "Page$2"})
WebBrowser1.Select()
Application.DoEvents()
SendKeys.Send("^a")
SendKeys.Send("^c")
pString = Clipboard.GetText()
aWrite = File.AppendText(qString)
aWrite.WriteLine(pString)
aWrite.Flush()
aWrite.Close()
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
|