S
S
Semyon2021-03-21 15:26:59
Parsing
Semyon, 2021-03-21 15:26:59

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

The code
res = page.frame[0].query_selector_all('.main_art') # Ничего
res = page.frame[0].child_frame[0].query_selector_all('.main_art') # Ничего

Page structure
<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 question

Ask a Question

731 491 924 answers to any question