how to check if page finished loading in RSelenium

后端 未结 3 626
我寻月下人不归
我寻月下人不归 2021-01-13 05:36

Imagine that you click on an element using RSelenium on a page and would like to retrieve the results from the resulting page. How does one check to make sure t

3条回答
  •  [愿得一人]
    2021-01-13 05:53

    In the RSelenium reference manual (http://cran.r-project.org/web/packages/RSelenium/RSelenium.pdf), you will find the method setTimeout() for the remoteDriver class:

    setTimeout(type = "page load", milliseconds = 10000)

    Configure the amount of time that a particular type of operation can execute for before they are aborted and a |Timeout| error is returned to the client.

    type: The type of operation to set the timeout for. Valid values are: "script" for script timeouts, "implicit" for modifying the implicit wait timeout and "page load" for setting a page load timeout. Defaults to "page load"

    milliseconds: The amount of time, in milliseconds, that time-limited commands are permitted to run. Defaults to 10000 milliseconds.

    This seems to suggests that remDr$setTimeout() after remDr$navigate("...") would actually wait for the page to load, or return a timeout error after 10 seconds.

提交回复
热议问题