The get_full_html method retrieves the complete HTML content of the current browser page without internal annotations, making it suitable for HTML analysis, content extraction, and page archiving.
The HTML returned by this method has all internal annotations stripped, ensuring you get clean, production-ready HTML.
Method Signature
async def get_full_html(
self,
*,
timeout: int | None = None,
) -> GetFullHtmlResponse
Parameters
Maximum time in seconds to wait for the HTML retrieval to complete. If None, uses the default system timeout.timeout=30 # Wait up to 30 seconds
timeout=None # Use default timeout
Return Value
Returns a GetFullHtmlResponse object with the following structure:
The complete HTML content of the current page as a string, with all internal annotations removed.# Example response
response.html = "<!DOCTYPE html><html><head>...</head><body>...</body></html>"
Example
import asyncio
from narada import Narada
async def main():
async with Narada() as narada:
window = await narada.open_and_initialize_browser_window()
# Navigate to a page
await window.go_to_url(url="https://example.com")
# Get the full HTML content
response = await window.get_full_html()
# Save HTML to a file
with open("page.html", "w", encoding="utf-8") as f:
f.write(response.html)
print("HTML content retrieved and saved")
if __name__ == "__main__":
asyncio.run(main())