Answer the question
In order to leave comments, you need to log in
Playwright: How to get the first iframe?
The site has two iframes. main_frame, frame_childs and frames produce only the second and they all skip the first frame (I know that the lists start from zero ([0]). What am I doing wrong?
PS The code is in python, but the names of the methods are the same in js
res = page.frame[0].query_selector_all('.main_art') # Ничего
res = page.frame[0].child_frame[0].query_selector_all('.main_art') # Ничего
<html>
<iframe>
<div class="main_art">Нужная инфа</div>
</iframe>
<iframe>
<p>Ненужная инфа</p>
</iframe>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question