c# - Loading a follow up page into a variable using WebBrowser -
i have below code , want know how make code wait webbrowser load next page after activating submit button:
webbrowser wb = new webbrowser(); wb.scrollbarsenabled = false; wb.scripterrorssuppressed = false; wb.navigate(baseurl+uri); while (wb.readystate != webbrowserreadystate.complete) { application.doevents(); } var doctitle1 = wb.documenttitle; foreach (htmlelement form in wb.document.forms) form.invokemember("submit"); stream datastream = wb.documentstream; streamreader reader = new streamreader(datastream); string responsefromserver = reader.readtoend(); console.writeline(responsefromserver);
i can hear click sound when activates submit hear when @ end of code. if put break in place, can see wb object has data previous page.
thanks!
Comments
Post a Comment