MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / print_page

Method print_page

py/selenium/webdriver/remote/webdriver.py:789–799  ·  view source on GitHub ↗

Takes PDF of the current page. The driver makes a best effort to return a PDF based on the provided parameters.

(self, print_options: PrintOptions | None = None)

Source from the content-addressed store, hash-verified

787 return self._accessibility_snapshotter
788
789 def print_page(self, print_options: PrintOptions | None = None) -> str:
790 """Takes PDF of the current page.
791
792 The driver makes a best effort to return a PDF based on the
793 provided parameters.
794 """
795 options: dict[str, Any] | Any = {}
796 if print_options:
797 options = print_options.to_dict()
798
799 return self.execute(Command.PRINT_PAGE, options)["value"]
800
801 @property
802 def switch_to(self) -> SwitchTo:

Calls 2

executeMethod · 0.95
to_dictMethod · 0.45