This article was co-authored by How.com.vn staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for How.com.vn. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions.
There are 7 references cited in this article, which can be found at the bottom of the page.
This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 63,909 times.
Learn more...
This How.com.vn teaches you how to locate and copy the HTML source code of a website on your computer, phone, or tablet. The steps are pretty straight-forward when you're using a computer or an Android, but if you're using an iPhone or iPad, you'll need a third-party app like View Source to get the job done.
Things You Should Know
- On a computer, right click a blank area of the website and choose View page source. Highlight all the text and hit Ctrl+C (PC) or ⌘ Cmd+C (Mac) to copy.
- On Android, add view-source: to the beginning of the website URL. Tap and hold to highlight a word. Drag the bars to encompass all of the code. Tap Copy.
- On Mac, install the View Source app. Copy and paste your website URL into the app and select go. Tap and hold any word to highlight it. Drag the bars to highlight more code and hit Copy.
Steps
- Go to the website you want to copy. You can use any web browser on your PC or Mac to view and copy a website's source code.
- Enable the Develop menu (if you're using Safari). If you're using Safari on a Mac, you'll need to enable the Develop menu if you want to view a website's source code.[1] This is only required on Safari, so you can skip this if you're using any other browser:
- Click the Safari menu at the top of the screen.
- Click Preferences on the menu.
- Click Advanced.
- Select Show Develop menu in menu bar.
Advertisement - Right-click a blank area of the website. A context menu will expand.
- Click View page source on the menu. The phrasing may vary slightly on different web browsers, but this option will always display the current page's source code.[2]
- If you right-clicked in a frame, you'll see View Frame Source instead.[3] This will only display the source code of the current frame.
- If you see a link to a file with a name like style.css near the top of the source code, this is a separate file that contains the styles (fonts, colors, layout info) for the website.[4] Click the link to open that page. If you want to copy all of the code for the site, you'll also need to copy this page.
- Press Ctrl+C (PC) or ⌘ Cmd+C (Mac). Now the selected source code is pasted to your clipboard.[6]
- To paste it into the desired location, right-click and select Paste.
- Open Chrome or Samsung Internet on your phone or tablet. You can use Google Chrome to view the source code of a website on your Android.[7]
- Go to the website you want to view. Wait for the site to load fully before you continue.
- Tap the address bar. This displays the address of the website.
- Add view-source: to the beginning of the URL. To do this, just move the cursor to the beginning of the URL (before the https://) and type view-source:.
- For example, if you were going to view the source of How.com.vn.com, the URL would look like this: view-source:https://www.wikihow.com
- Tap the search, enter, or go key to go to the site. This refreshes the site and displays only its source code.
- If you see a link to a file with a name like style.css near the top of the source code, this is a separate file that contains the styles settings (colors, fonts, design, etc.) for the website. Tap the link to open that page. If you want to copy all of the code for the site, you'll also need to copy this page.
- Tap and hold any word in the source code. This highlights that word and surrounds it by bounding handles.
- Drag the bounding handles to select all of the source code. To do this, drag the leftmost bounding handle all the way to the beginning of the page, and the rightmost handle all the way to the end. A small toolbar will appear once you're finished.
- Tap Copy on the toolbar. Now that you've copied the source code, you can paste it anywhere, such as into Google Docs or your note-taking app.
- To paste the code into a file or app, tap and hold the typing area and select Paste.
- Install View Source from the App Store . There's no setting in any iPhone or iPad web browser that lets you view a website's source code easily. Fortunately, there's an app for that! View Source is a small, easy-to-use app that lets you view and copy the source code of any website.
- Open Safari (or your preferred web browser). You can still use your regular browser to load the website you want to view.
- Copy the URL. Once you're on the page you want to view, tap the address bar at the top of the screen to select the URL. Then, tap it again to bring open the context menu and select Copy.
- Open the View Source app. It's the purple icon with a black window, two brackets, and a semicolon. You'll find it on your home screen and/or your app library.
- Tap the address bar and select Paste. This pastes the copied URL into the address bar in View Source.
- Tap the go key on the keyboard. This displays the source code for the URL you entered.
- Tap and hold any word in the source code. This highlights that word and surrounds it by bounding handles.
- Drag the bounding handles to select all of the source code. To do this, drag the leftmost bounding handle all the way to the beginning of the page, and the rightmost handle all the way to the end. A small toolbar will appear once you're finished.
- Tap Copy on the menu. If it doesn't pop up on its own, tap and hold the highlighted area so it appears, and then select Copy. Once the source code is copied to the clipboard, you can paste it into any app you want, such as the Notes app or an email message.
- To paste, tap and hold a typing area and select Paste.[8]
Expert Q&A
Video
Tips
References
- ↑ https://support.apple.com/guide/safari/use-the-developer-tools-in-the-develop-menu-sfri20948/mac
- ↑ https://support.google.com/surveys/answer/6172725?hl=en
- ↑ https://www.webnots.com/view-webpage-source-css-in-google-chrome/
- ↑ https://www.tutsandtips.com/html/copy-all-html-source-code-with-inspect-in-chrome/
- ↑ https://support.apple.com/en-us/102553
- ↑ https://support.apple.com/en-us/102553
- ↑ https://www.view-page-source.com/howto-see-html-code-different-browsers/
- ↑ https://support.apple.com/guide/iphone/select-and-edit-text-iph1a9cae52c/ios
About This Article
1.Go to the website in a web browser.
2.If you're using Safari on a Mac, enable the Develop menu.
3.Right-click a blank area of the page.
4.Click View page source.
5.Highlight everything on the page.
6.Right-click the selection and click Copy.
Is this article up to date?
⚠️ Disclaimer:
Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.
- - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
- - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
- - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
- - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.