mirror of https://github.com/zulip/zulip.git
puppeteer: Fix get_element_text including hidden text.
Previously, this function used the `textContent` property, which includes hidden elements. Fix this by using innerText instead.
This commit is contained in:
parent
67771f80d0
commit
72166f1b03
|
@ -192,7 +192,7 @@ class CommonUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
async get_element_text(element: ElementHandle<Element>): Promise<string> {
|
async get_element_text(element: ElementHandle<Element>): Promise<string> {
|
||||||
return (await element.getProperty("textContent"))!.jsonValue();
|
return (await element.getProperty("innerText"))!.jsonValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
async get_text_from_selector(page: Page, selector: string): Promise<string> {
|
async get_text_from_selector(page: Page, selector: string): Promise<string> {
|
||||||
|
|
Loading…
Reference in New Issue