From this link, I assume the DOM should be loaded as a whole at first in RAM.
How DOM works/is loaded? (in HTML)
But then I test in Selenium with a timeout exception. It seems even the timeout exception is raised, some elements can already be found, so it is not an empty object.
But I am wondering, how can I make sure some elements are already loaded? E.g. the HTML example, how can I make sure all <th>
elements are loaded? Given the fact that I actually do not know the number of the <th>
elements.
Code trial :
driver = webdriver.Chrome()
driver.set_page_load_timeout(10)
try:
driver.get(url)
print('load success!')
except TimeoutException:
print(self.page_source)
Sample HTML:
<table width="910" border="0" cellpadding="3" cellspacing="0" id="fth1_" class="fth1_" style="display: none; position: fixed; top: 29px; left: 99px;">
<thead style="background-color: rgb(233, 233, 233);">
<tr align="center">
<th id="f13" style="width: 121px;"><a href="t/?i=614&o=1">Symbol</a></th>
<th id="f13" style="width: 267px;"><a href="t/?i=614&o=2">Name</a></th>
</tr>
</thead>
</table>