How do you get the HTML of a web page?
To get the HTML of a web page, start with Ctrl+U or right-click and choose “View page source”. If the page is generated with JavaScript, open the browser inspector instead, select the body or html tag, and copy its outer HTML.
Explanation
There are two ways to get a page’s HTML, and they do not always return the same result. The page source shows the initial HTML sent by the server. This is enough for a simple or static page. The inspector shows the current DOM, meaning the structure after JavaScript may have changed the page. On a modern app, an e-commerce website or a dynamically loaded page, this second method is often more reliable for getting the content that is actually visible before converting it to Markdown or analyzing it with AI.
Formula / method
Quick method:
- Open the page in your browser.
- Press
Ctrl+Uor right-click → “View page source”. - Copy the displayed HTML.
Reliable method for dynamic pages:
- Open developer tools.
- Go to the Elements / Inspector panel.
- Select
bodyorhtml. - Right-click → Copy → Copy outerHTML.
- Paste the result into your HTML to Markdown converter.
Concrete example
If you copy the source code of a product page and the converter retrieves almost nothing, the content is probably added after load by JavaScript. In that case, copy the HTML from the inspector instead of the page source.
Common mistake
Do not confuse initial HTML with the displayed DOM. Initial HTML can be incomplete on dynamic pages, while the DOM often contains the content that is actually visible. Also be careful with private or protected content: only copy what you are allowed to use.
Sources & methodology
- Chrome DevTools — View and change the DOM — Documentation on inspecting nodes, the Elements panel and the difference between initial HTML and the current DOM.
- MDN — Document Object Model (DOM) — Reference on the DOM as a structured and manipulable representation of a web page.
- WHATWG — HTML Standard — Reference specification for HTML and the structure of web documents.
This content follows Outilo's editorial guidelines.