================================ Manipulating frames with webpage ================================ A web page may have different frames, and even some frames inside frames. If you want to do things related to a specific frame, like evaluating code, the `webpage <../api/webpage.html>`_ object have some methods to select the frame you want to work with. These methods are: - `webpage.switchToFocusedFrame() <../api/webpage.html#webpage-switchtofocusedframe>`_: to select the frame that has the focus. You can retrieve its name with `webpage.focusedFrameName <../api/webpage.html#webpage-focusedframename>`_. - `webpage.switchToFrame(framename) <../api/webpage.html#webpage-switchtoframe>`_ (or ``webpage.switchToChildFrame()``): to select a frame (in the current frame) that has the given name. You can retrieve the list of frame names with `framesName <../api/webpage.html#webpage-framesname>`_, and the count with `framesCount <../api/webpage.html#webpage-framescount>`_. - `webpage.switchToParentFrame() <../api/webpage.html#webpage-switchtoparentframe>`_: to select the parent frame of the current frame - `webpage.switchToMainFrame() <../api/webpage.html#webpage-switchtomainframe>`_: to return to the main frame (i.e. the root window) Exemple to select an frame -------------------------- .. code-block:: html root window: .. code-block:: html frame1.html: ...