How do you get source code of all the child elements of an HTML element that gets rendered by Javascript and is not visible in view source? (using selenium's php library)
Asked
Active
Viewed 606 times
1 Answers
2
For example if it's an element with class name "ListTable" you would wait for your target element to load with
$driver->wait(10, 1000)->until(
WebDriverExpectedCondition::visibilityOfElementLocated(WebDriverBy::className("ListTable"))
);
then get the content of the DOM inside this div class using:
$content = $driver->findElement(WebDriverBy::className("ListTable"))->getAttribute('innerHTML');

Robert Sinclair
- 4,550
- 2
- 44
- 46