Skip to main content

browse_with_paging

browse Returns only the references list and discards the continuation_point; this is suitable for nodes where "the number of children does not exceed a single page (up to 1,000 entries per underlying request)." For nodes where the number of children may exceed a single page, use to explicitly browse_with_paging retrieve them BrowsePage.

Prerequisite Reading

Signature​

def browse_with_paging(self,
node_id: str,
filter: NodeClass = NodeClass.Unspecified) -> BrowsePage: ...

Usage​

page = ua.browse_with_paging("ns=2;s=BigFolder")
print(f"Got {len(page.references)} children, more = {page.continuation_point is not None}")

if page.continuation_point is not None:
nxt = ua.browse_next(page.continuation_point)
print(f"Next page: {len(nxt.references)} more children")

When to Use browse vs browse_with_paging​

ScenarioAPI
Given that the number of children does not exceed one page (≤ 1000), pagination is not a concern.browse(...)
I'm not sure how many children there are, so just to be safe...browse_with_paging(...) + loop browse_next
Large nodes that may have thousands of child nodesbrowse_with_paging(...) Required
Once browse Multiple nodesbrowse_many(...) (Note: Currently, browse_many does not return anything. ContinuationPoint)

Complete Template​

Python SDK None Built-in automatic page-turning API ( BrowseAll extension methods are available only on the C# side); you can simply write your own helper function:

from darra_opcua import OpcUaSession, NodeClass, Reference
from typing import List

def browse_all_refs(ua: OpcUaSession,
node_id: str,
filter: NodeClass = NodeClass.Unspecified) -> List[Reference]:
all_refs: List[Reference] = []
page = ua.browse_with_paging(node_id, filter)
all_refs.extend(page.references)
while page.continuation_point is not None:
page = ua.browse_next(page.continuation_point)
all_refs.extend(page.references)
return all_refs

Next Step​