Skip to content

[Bug]: tab.get_frame() Unable to locate frame #300

@sadikhan918

Description

@sadikhan918

Checklist before reporting

  • I have searched for similar issues and didn't find a duplicate.
  • I have updated to the latest version of pydoll to verify the issue still exists.

pydoll Version

2.12.0

Python Version

3.13.5

Operating System

Windows

Bug Description

For some reason I am unable to locate an iframe on a page using get_frame().

Steps to Reproduce

  1. Open page with valid IFrame within it
  2. Find the IFrame element using tab.find() or another method
  3. Attempt to get the frame using tab.get_frame() and the element found in step 2

Code Example

try:
                    iframeElements = await page.find(tag_name='iframe', find_all=True)
                    for c in iframeElements : 
                        if 'someSpecificURL' in c._attributes['src']:
                            iframeElement = c
                            # The frame is being found here (not null)
                            break
                    iframe = await page.get_frame(iframeElement)
                   # continue to do things
                except Exception as e:
                    # Getting 'The target for the iframe was not found' Error


# another approach



                try:
                    iframeElement = await page.find(tag_name='iframe', title='someSpecificTitle')
                    # The frame is being found here (not null)
                    iframe = await page.get_frame(iframeElement)
                   # continue to do things
                except Exception as e:
                    # Getting 'The target for the iframe was not found' Error

Expected Behavior

The page should find the iframe.

Actual Behavior

The page throws an 'The target for the iframe was not found' error.

Relevant Log Output

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions