Hi what i am trying to do is not to get the webpage as
page.open(url);
but to set a string that has already been retrieved as the page response. Can that be done?
Hi what i am trying to do is not to get the webpage as
page.open(url);
but to set a string that has already been retrieved as the page response. Can that be done?
Yes, and it is as easy as assigning to page.content. It is usually also worth setting a page.url (as otherwise you might hit cross-domain issues if doing anything with Ajax, SSE, etc.), and the
setContent
function is helpful to do both those steps in one go. Here is the basic example:So call page.setContent with the "previously retrieved page response" that you have.