Skip to main content

evaluate_in_all_frames

Function evaluate_in_all_frames 

Source
pub async fn evaluate_in_all_frames<T>(
    page: &Page,
    expression: &str,
) -> Result<Vec<T>>
Expand description

Evaluate expression in every frame of the page (main document + all iframes) and return the deserialized results from every frame that produced a valid value.

This is the robust replacement for parent-page JS that tries to walk into iframe.contentDocument.

ยงExample

use runtime_foxdriver::frame::evaluate_in_all_frames;
let titles: Vec<String> = evaluate_in_all_frames(page, "document.title").await?;