rstudio / chromote

Chrome Remote Interface for R
https://rstudio.github.io/chromote/
156 stars 20 forks source link

How to capture the time effect when a section of the web page is loaded (not entire page)?. #164

Open sale4cast opened 3 months ago

sale4cast commented 3 months ago

There is a web page (picture is below) and it has three sections. These three sections are header section, side section and body section. In the side section, there is a button. Once you click on this button, the new information will be loaded in the body section. The URL of the web page before and after clicking are identical. My question is, how to capture the time effect of loading data in the body section?

Note: I have already tried by using Page$loadEventFired(wait = FALSE) function. It can capture the time effect when the entire web page is being loaded. But it can not capture the time effect of loading data when only a section of the web page is loaded.

picture
wch commented 3 months ago

What you do here will really depend on specifics of how the page loads the content. The Chrome Devtools Protocol documentation might have some relevant events to listen for: https://chromedevtools.github.io/devtools-protocol/

sale4cast commented 3 months ago

Dear Winston, Thanks for your comments and your previous help. Can you please explain the sentence of your comment by an small example "it will really depend on specifics of how the page loads the content."?.

To provide more information to you about the problem, I feel to attach an screenshot in below. After clicking on "done" button (highlighted in the top right corner of screenshot), the new room price is loaded in the body section within 2-3 seconds. We are struggling to capture the loading time effect of this 2-3 seconds. Note: the entire page is not loaded and therefore the URL of entire web page before and after the clicking is identical.

problem_image