from typing import TypedDictfrom playwright.async_api import Pagefrom intuned_browser import extract_markdownclass Params(TypedDict): passasync def automation(page: Page, params: Params, **_kwargs): await page.goto("https://books.toscrape.com/") header_locator = page.locator('h1').first # First title on the page markdown = await extract_markdown(header_locator) # Extract markdown from the first title print(markdown) return markdown
The source of the HTML content. When a Page is provided, extracts from the entire page. When a Locator is provided, extracts from that specific element.
Returns: str
The markdown representation of the HTML content
⌘I
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/docs.json","name":"Intuned","colors":{"primary":"#f4672f","light":"#f57847","dark":"#e86430"},"logo":{"light":"https://mintcdn.com/intuned-dev/afjZxAQhak8dZFgC/logo/light.svg?fit=max\u0026auto=format\u0026n=afjZxAQhak8dZFgC\u0026q=85\u0026s=8c29600bacd9dae40a8e850d36c7d2cc","dark":"https://mintcdn.com/intuned-dev/afjZxAQhak8dZFgC/logo/dark.svg?fit=max\u0026auto=format\u0026n=afjZxAQhak8dZFgC\u0026q=85\u0026s=08ffc206f0d939f6e2db3904b0f0134b"},"favicon":"https://mintcdn.com/intuned-dev/D6lboD5NsphRQ1iL/favicon.svg?fit=max\u0026auto=format\u0026n=D6lboD5NsphRQ1iL\u0026q=85\u0026s=06269f8e6ec0bbb9ae63fcd6032d41d2","api":{"openapi":["_resources/openapi/generated/all_generated.yaml"]},"background":{"color":{"light":"#fafafa","dark":"#22252a"}},"navbar":{"links":[{"href":"https://intunedhq.com/docs/main/06-resources/help-and-support","label":"Need help?"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.intuned.io"}},"footer":{"socials":{"website":"https://intunedhq.com/","github":"https://github.com","twitter":"https://twitter.com/intunedhq","linkedin":"https://www.linkedin.com/company/intunedhq","discord":"https://discord.gg/cRAtnKH4jf"}},"integrations":{"koala":{"publicApiKey":"pk_956f5458cba963529649a33418512ff1e594"},"posthog":{"apiKey":"phc_C0j5PCIsnnLrj2pbDpjYrxD9yO2CBdZQoxvI9AWgQfZ","apiHost":"https://app.intuned.io/pohi"}},"contextual":{"options":["copy","chatgpt","claude","vscode","view"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"intuned-dev","hasAudioNarration":false,"actualSubdomain":"intuned-dev","customDomains":["intunedhq.com"],"gitSource":{"type":"github","owner":"intuned","repo":"webapp","deployBranch":"master","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6af9f8bb7fd385b08ebf61c8","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Documentation","count":107},{"language":"default","tag":"Browser SDKs","count":61},{"language":"default","tag":"Typescript SDK","count":34},{"language":"default","tag":"References","count":34},{"language":"default","tag":"Client APIs","count":30},{"language":"default","tag":"Python SDK","count":26},{"language":"default","tag":"Type References","count":22},{"language":"default","tag":"Learn","count":19},{"language":"default","tag":"Platform features","count":17},{"language":"default","tag":"Quick recipes","count":15}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@intunedhq.com","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"a:has(code){border-bottom:0px!important}a code:hover{border-bottom:1px solid rgb(var(--primary-light))!important}#sidebar li div{overflow:hidden;text-overflow:ellipsis}:root{--gray-400: 204 204 204}.dark .accordion-group{border-color:rgba(20, 22, 26, 0.7)!important;background-color:#1d1f24!important}.dark .accordion{border-color:rgba(20, 22, 26, 0.7)!important;background-color:#1d1f24!important}.dark .card{background-color:#1d1f24!important;color:#fff!important}.dark .code{background-color:#1d1f24!important;color:#fff!important}.dark [data-component-part=\"code-block-root\"]{background-color:#111215!important}"}],"page":{"pagePath":"automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown","slug":"/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown","pageMetadata":{"title":"extract_markdown","description":null,"href":"/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Converts HTML content from a Playwright Page or Locator to semantic markdown format.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` extract_markdown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: Page `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`|`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Locator,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Extract Markdown from Locator`,numberOfLines:`11`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` typing `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` TypedDict`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` playwright.async_api `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Page`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` intuned_browser `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` extract_markdown`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Params`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`TypedDict`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` automation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`page`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: Page, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`params`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: Params, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`_kwargs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` page.goto(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://books.toscrape.com/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` header_locator `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` page.locator(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'h1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).first `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# First title on the page`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` markdown `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` extract_markdown(header_locator) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Extract markdown from the first title`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(markdown)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` markdown`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Extract Markdown from Page`,numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` typing `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` TypedDict`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` playwright.async_api `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Page`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` intuned_browser `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` extract_markdown`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Params`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`TypedDict`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` automation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`page`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: Page, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`params`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: Params, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`_kwargs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` page.goto(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://sandbox.intuned.dev/pdfs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` markdown `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` extract_markdown(page)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(markdown)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` markdown`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`arguments`,children:`Arguments`}),`\n`,_jsx(ResponseField,{name:`source`,type:`Page | Locator`,required:true,id:`param-source`,children:_jsx(_components.p,{children:`The source of the HTML content. When a Page is provided, extracts from the entire page. When a Locator is provided, extracts from that specific element.`})}),`\n`,_jsxs(Heading,{level:`2`,id:`returns-str`,children:[`Returns: `,_jsx(_components.code,{children:`str`})]}),`\n`,_jsx(_components.p,{children:`The markdown representation of the HTML content`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"extract_markdown","description":null,"href":"/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Examples","slug":"examples","depth":2,"children":[]},{"title":"Arguments","slug":"arguments","depth":2,"children":[]},{"title":"Returns: str","slug":"returns-str","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/intuned-dev/330f1f878769cd36/rb2b.js"],"subdomain":"intuned-dev","siteName":"Intuned","title":"extract_markdown - Intuned","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-02T15:31:15.192Z","originalFileLocation":"automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Intuned\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/intuned-dev/c1oeYU5knDlFGNKO/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/intuned-dev/c1oeYU5knDlFGNKO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/intuned-dev/c1oeYU5knDlFGNKO/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/intuned-dev/c1oeYU5knDlFGNKO/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/intuned-dev/c1oeYU5knDlFGNKO/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/intuned-dev/c1oeYU5knDlFGNKO/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/intuned-dev/c1oeYU5knDlFGNKO/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/intuned-dev/c1oeYU5knDlFGNKO/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/intuned-dev/c1oeYU5knDlFGNKO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"extract_markdown - Intuned\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Intuned\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://intuned-dev.mintlify.site/docs/_mintlify/api/og/v2?division=Python+SDK\u0026amp;title=extract_markdown\u0026amp;theme=0481e9f80136a4886c4612f0\u0026amp;signature=b9fb88e648b752c6e5597133dc385a32a8d87f68497ef4ff184ca8773785a32b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"extract_markdown - Intuned\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://intuned-dev.mintlify.site/docs/_mintlify/api/og/v2?division=Python+SDK\u0026amp;title=extract_markdown\u0026amp;theme=0481e9f80136a4886c4612f0\u0026amp;signature=b9fb88e648b752c6e5597133dc385a32a8d87f68497ef4ff184ca8773785a32b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/intuned-dev/c1oeYU5knDlFGNKO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Intuned\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#f4672f\">\u003clink data-mint-head rel=\"canonical\" href=\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://intunedhq.com/#organization\",\"name\":\"Intuned\",\"url\":\"https://intunedhq.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/intuned-dev/afjZxAQhak8dZFgC/logo/light.svg?fit=max\u0026auto=format\u0026n=afjZxAQhak8dZFgC\u0026q=85\u0026s=8c29600bacd9dae40a8e850d36c7d2cc\"}},{\"@type\":\"WebSite\",\"@id\":\"https://intunedhq.com/docs#website\",\"name\":\"Intuned\",\"url\":\"https://intunedhq.com/docs\",\"publisher\":{\"@id\":\"https://intunedhq.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown#webpage\",\"url\":\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown\",\"name\":\"extract_markdown\",\"dateModified\":\"2026-11-02T15:31:15.192Z\",\"isPartOf\":{\"@id\":\"https://intunedhq.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Python SDK\",\"item\":\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"extract_markdown\",\"item\":\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown#article\",\"headline\":\"extract_markdown\",\"name\":\"extract_markdown\",\"url\":\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown\",\"mainEntityOfPage\":{\"@id\":\"https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown#webpage\"},\"dateModified\":\"2026-11-02T15:31:15.192Z\",\"publisher\":{\"@id\":\"https://intunedhq.com/#organization\"},\"isPartOf\":{\"@id\":\"https://intunedhq.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Intuned\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Intuned\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown.md","siteName":"Intuned","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/main/00-getting-started/introduction"}]},{"anchor":"Browser SDKs","icon":"code","groups":[{"group":"Introduction","icon":"book","pages":[{"title":"Overview","icon":"book-open","href":"/automation-sdks/overview"}]},{"group":"Typescript SDK","icon":"js","pages":[{"title":"TypeScript SDK","sidebarTitle":"@intuned/browser","icon":"cube","href":"/automation-sdks/intuned-sdk/typescript/overview"},{"title":"extractStructuredData","icon":"wand-magic-sparkles","href":"/automation-sdks/intuned-sdk/typescript/ai/functions/extractStructuredData"},{"title":"isPageLoaded","icon":"wand-magic-sparkles","href":"/automation-sdks/intuned-sdk/typescript/ai/functions/isPageLoaded"},{"title":"extractMarkdown","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/extractMarkdown"},{"title":"sanitizeHtml","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/sanitizeHtml"},{"title":"resolveUrl","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/resolveUrl"},{"title":"downloadFile","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/downloadFile"},{"title":"uploadFileToS3","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/uploadFileToS3"},{"title":"saveFileToS3","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/saveFileToS3"},{"title":"filterEmptyValues","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/filterEmptyValues"},{"title":"goToUrl","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/goToUrl"},{"title":"scrollToLoadContent","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/scrollToLoadContent"},{"title":"clickUntilExhausted","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/clickUntilExhausted"},{"title":"processDate","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/processDate"},{"title":"validateDataUsingSchema","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/validateDataUsingSchema"},{"title":"waitForDomSettled","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/waitForDomSettled"},{"title":"withNetworkSettledWait","href":"/automation-sdks/intuned-sdk/typescript/helpers/functions/withNetworkSettledWait"},{"group":"Type References","pages":[{"title":"Attachment","href":"/automation-sdks/intuned-sdk/typescript/helpers/type-references/Attachment"},{"title":"S3Configs","href":"/automation-sdks/intuned-sdk/typescript/helpers/type-references/S3Configs"},{"title":"AttachmentType","href":"/automation-sdks/intuned-sdk/typescript/helpers/type-references/AttachmentType"},{"title":"FileType","href":"/automation-sdks/intuned-sdk/typescript/helpers/type-references/FileType"},{"title":"Trigger","href":"/automation-sdks/intuned-sdk/typescript/helpers/type-references/Trigger"},{"title":"ImageBufferContentItem","href":"/automation-sdks/intuned-sdk/typescript/ai/type-references/ImageBufferContentItem"},{"title":"ImageUrlContentItem","href":"/automation-sdks/intuned-sdk/typescript/ai/type-references/ImageUrlContentItem"},{"title":"TextContentItem","href":"/automation-sdks/intuned-sdk/typescript/ai/type-references/TextContentItem"},{"title":"ContentItem","href":"/automation-sdks/intuned-sdk/typescript/ai/type-references/ContentItem"}]},{"group":"Optimized extractors (Deprecated)","pages":[{"title":"extractArrayFromPage","href":"/automation-sdks/intuned-sdk/typescript/optimized-extractors/functions/extractArrayFromPage"},{"title":"extractArrayFromLocator","href":"/automation-sdks/intuned-sdk/typescript/optimized-extractors/functions/extractArrayFromLocator"},{"title":"extractObjectFromPage","href":"/automation-sdks/intuned-sdk/typescript/optimized-extractors/functions/extractObjectFromPage"},{"title":"extractObjectFromLocator","href":"/automation-sdks/intuned-sdk/typescript/optimized-extractors/functions/extractObjectFromLocator"},{"group":"Type References","pages":[{"title":"SimpleArrayItemSchema","href":"/automation-sdks/intuned-sdk/typescript/optimized-extractors/type-references/SimpleArrayItemSchema"},{"title":"SimpleArrayStringSchema","href":"/automation-sdks/intuned-sdk/typescript/optimized-extractors/type-references/SimpleArrayStringSchema"},{"title":"SimpleObjectSchema","href":"/automation-sdks/intuned-sdk/typescript/optimized-extractors/type-references/SimpleObjectSchema"},{"title":"SimpleObjectStringSchema","href":"/automation-sdks/intuned-sdk/typescript/optimized-extractors/type-references/SimpleObjectStringSchema"}]}]}]},{"group":"Python SDK","icon":"python","pages":[{"title":"Python SDK","sidebarTitle":"intuned_browser","icon":"cube","href":"/automation-sdks/intuned-sdk/python/overview"},{"title":"extract_structured_data","icon":"wand-magic-sparkles","href":"/automation-sdks/intuned-sdk/python/ai/functions/extract_structured_data"},{"title":"is_page_loaded","icon":"wand-magic-sparkles","description":null,"href":"/automation-sdks/intuned-sdk/python/ai/functions/is_page_loaded"},{"title":"extract_markdown","href":"/automation-sdks/intuned-sdk/python/helpers/functions/extract_markdown"},{"title":"sanitize_html","description":null,"href":"/automation-sdks/intuned-sdk/python/helpers/functions/sanitize_html"},{"title":"resolve_url","href":"/automation-sdks/intuned-sdk/python/helpers/functions/resolve_url"},{"title":"download_file","href":"/automation-sdks/intuned-sdk/python/helpers/functions/download_file"},{"title":"upload_file_to_s3","href":"/automation-sdks/intuned-sdk/python/helpers/functions/upload_file_to_s3"},{"title":"save_file_to_s3","href":"/automation-sdks/intuned-sdk/python/helpers/functions/save_file_to_s3"},{"title":"filter_empty_values","href":"/automation-sdks/intuned-sdk/python/helpers/functions/filter_empty_values"},{"title":"go_to_url","href":"/automation-sdks/intuned-sdk/python/helpers/functions/go_to_url"},{"title":"scroll_to_load_content","href":"/automation-sdks/intuned-sdk/python/helpers/functions/scroll_to_load_content"},{"title":"click_until_exhausted","href":"/automation-sdks/intuned-sdk/python/helpers/functions/click_until_exhausted"},{"title":"process_date","href":"/automation-sdks/intuned-sdk/python/helpers/functions/process_date"},{"title":"validate_data_using_schema","href":"/automation-sdks/intuned-sdk/python/helpers/functions/validate_data_using_schema"},{"title":"wait_for_dom_settled","href":"/automation-sdks/intuned-sdk/python/helpers/functions/wait_for_dom_settled"},{"title":"wait_for_network_settled","href":"/automation-sdks/intuned-sdk/python/helpers/functions/wait_for_network_settled"},{"group":"Type References","pages":[{"title":"Attachment","href":"/automation-sdks/intuned-sdk/python/helpers/type-references/Attachment"},{"title":"AttachmentType","href":"/automation-sdks/intuned-sdk/python/helpers/type-references/AttachmentType"},{"title":"S3Configs","href":"/automation-sdks/intuned-sdk/python/helpers/type-references/S3Configs"},{"title":"FileType","href":"/automation-sdks/intuned-sdk/python/helpers/type-references/FileType"},{"title":"Trigger","href":"/automation-sdks/intuned-sdk/python/helpers/type-references/Trigger"},{"title":"ImageBufferContentItem","href":"/automation-sdks/intuned-sdk/python/ai/type-references/ImageBufferContentItem"},{"title":"ImageUrlContentItem","href":"/automation-sdks/intuned-sdk/python/ai/type-references/ImageUrlContentItem"},{"title":"TextContentItem","href":"/automation-sdks/intuned-sdk/python/ai/type-references/TextContentItem"},{"title":"ContentItem","href":"/automation-sdks/intuned-sdk/python/ai/type-references/ContentItem"}]}]}]},{"anchor":"Client APIs","icon":"server","pages":[{"title":"Client APIs","href":"/client-apis/overview"}]},{"anchor":"Changelog","icon":"calendar","hidden":true,"pages":[{"title":"Changelog","href":"/changelog/product-updates"}]},{"anchor":"Intuned Agent API (Experimental)","icon":"robot","hidden":true,"pages":[{"title":"Intuned Agent API (Experimental)","href":"/client-apis/api-reference/agent/overview"}]}]},"basePath":"","title":"extract_markdown - Intuned","buildId":"dpl_Aw98ji4XvBsgtZwL1VrkUF9ehFqz","deploymentId":"dpl_Aw98ji4XvBsgtZwL1VrkUF9ehFqz","dynamics":[],"chunks":[]}