Developer Guideshow to convert website inspect page to markdown

How to Convert Website HTML from Inspect Element to Markdown

Learn how to inspect a webpage, extract its HTML using browser DevTools, and convert the content into a clean Markdown file.

WebToMarkdown Team· Browser Automation & DevTools
7 min read
#DevTools#HTML#Markdown#Tutorial#Browser

What Is Inspect Element?

Inspect Element is a built-in feature of modern web browsers (Google Chrome, Safari, Mozilla Firefox, Microsoft Edge, and Brave) that gives you direct access to the live Document Object Model (DOM) of any webpage.

Unlike "View Page Source", which only shows the raw HTML sent over the initial network request, Inspect Element displays the currently rendered DOM, including content generated dynamically by JavaScript frameworks like React, Angular, and Vue.


When Should You Use Inspect Element Instead of URL Fetching?

Automated URL converters fetch pages from remote servers. However, automated crawlers fail in several everyday scenarios:

  1. Pages Behind a Login: Internal dashboards, private Notion wikis, Jira tickets, or account settings.
  2. Paywalled or Subscription Content: Articles that require an active logged-in browser session.
  3. Client-Side Heavy SPAs: Web apps that render content only after extensive user interactions or clicks.
  4. Intranet or Localhost URLs: Internal development servers (http://localhost:3000) not reachable from the public internet.

In these situations, your local browser already has the authenticated, rendered content. You can simply inspect it, copy the HTML, and convert it to Markdown.


Step 1: Open Browser Developer Tools

You can open Developer Tools in any desktop browser in one second:

Operating SystemGoogle Chrome & EdgeMozilla FirefoxApple Safari
macOSCmd + Option + ICmd + Option + CCmd + Option + I (Enable in Safari > Settings > Advanced)
Windows / LinuxF12 or Ctrl + Shift + IF12 or Ctrl + Shift + CN/A
Mouse ShortcutRight-click anywhere on the page and select Inspect

Step 2: Find the Main Content Element

  1. Click the Element Selector tool (the small cursor/arrow icon in the top-left corner of DevTools, or press Cmd + Shift + C on macOS / Ctrl + Shift + C on Windows).
  2. Hover over the main article or documentation container on the webpage until the blue selection box highlights the core content.
  3. Click once. The Elements panel will automatically jump to and highlight that specific HTML node.
  4. Look for semantic tags such as:

- <article>

- <main>

- <div class="post-content"> or <div class="markdown-body">

  1. Select the highest parent container that contains all the headings, text, code, and images you wish to convert, while excluding sidebars and footers.

Step 3: Copy OuterHTML from the Elements Panel

  1. Right-click on the highlighted DOM node in the Elements panel.
  2. In the context menu, navigate to Copy > Copy outerHTML.
  3. The entire HTML structure of that section, including all nested child tags, is now copied to your clipboard.
Tip: Never use "Copy element" in older versions of Chrome, as it may copy the DevTools text representation rather than valid HTML. Always choose Copy outerHTML.

Step 4: Convert HTML into Clean Markdown

  1. Open the WebToMarkdown HTML Converter.
  2. Paste the copied HTML code into the input box.
  3. Choose your options:

- Keep Links: Retains hyperlinks in Markdown format ([text](url)).

- Keep Images: Retains image URLs and alt text.

- Include Metadata: Adds document frontmatter.

  1. Click Convert to Markdown. The tool cleans up all unneeded classes, styles, and wrapper tags and produces clean GitHub-Flavored Markdown.

Step 5: Download the Resulting .md File

Once converted, inspect the side-by-side preview:

  • Click Copy Markdown to paste into ChatGPT, Cursor, or Claude.
  • Click Download .md to save the document into your Obsidian vault or local project repository.

Common Pitfalls and How to Fix Them

  • Missing Images due to Lazy Loading: If images are missing, scroll to the bottom of the webpage first before opening DevTools so the browser triggers src loading on all lazy images.
  • Embedded SVG Icons: DevTools often copies massive SVG strings for UI icons. WebToMarkdown automatically identifies and strips unneeded decorative SVG code during conversion.
  • Accidentally Copying the Entire `<body>`: If you copy the root <body> tag, you will include navigation and footers. Take 5 seconds to select the inner <main> or <article> tag instead.
Product Tool

Convert Copied HTML to Clean Markdown

Have HTML copied from Inspect Element? Paste it into our HTML-to-Markdown converter for instantaneous GFM output.

Frequently Asked Questions

Does copying HTML through Inspect Element save images?

It preserves the image URLs referenced in the `<img>` tags. When converted to Markdown, they remain standard Markdown image links.

Can I use this method to save paid or member-only articles?

If your personal account has legitimate access and the full content is rendered in your browser DOM, you can copy the outerHTML for your personal reading and note-taking.

Why not just copy-paste the rendered text from the browser window?

Copying rendered text directly often loses heading hierarchy, breaks code block formatting, drops image URLs, and turns tables into tab-separated jumbles. Converting HTML preserves formatting accurately.

Does this work on mobile devices?

Most mobile browsers do not expose DevTools directly. It is recommended to perform Inspect Element extraction on desktop browsers.

W

WebToMarkdown Team

Browser Automation & DevTools at WebToMarkdown

Dedicated to helping developers, AI researchers, and knowledge workers extract, clean, and convert unstructured web content into portable Markdown.

Related Articles & Tutorials

All articles
AI & LLM10 min read
Sending documents as Markdown is 40%–80% more token-efficient and cost-effective than sending PDFs or Word files to LLMs. Discover how to eliminate the PDF vision tax, format tables and headings, and cut token costs.
Web Research6 min read
Tired of broken bookmarks and bloated PDF printouts? Learn how to save online articles, tutorials, and research directly as lightweight, future-proof Markdown (.md) files.
Developer Guides9 min read
Build your own Python web-to-markdown pipeline with requests, BeautifulSoup, and markdownify, or connect to the WebToMarkdown API for production-grade scraping.