在 Google Chrome 的检查元素中复制 HTML 代码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23343191/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 01:39:40  来源:igfitidea点击:

Copying HTML code in Google Chrome's inspect element

htmlgoogle-chromecopygoogle-chrome-devtoolsinspect-element

提问by user3581631

I have a website of wich I want to copy an HTML code from - how do I copy all the text in inspect element- so I don't get the website's HTML code, but the code that I have already changed so that I don't have elements I don't want in my own webpage?

我有一个网站,我想从中复制 HTML 代码 -如何复制检查元素中的所有文本- 所以我没有获得网站的 HTML 代码,但我已经更改了代码,所以我没有我自己的网页中没有我不想要的元素?

回答by barryjones

Do the following:

请执行下列操作:

  1. Select the top most element, you want to copy. (To copy all, select <html>)
  2. Right click.
  3. Select Edit as HTML
  4. New sub-window opens up with the HTML text.
  5. This is your chance. Press CTRL+A/CTRL+C and copy the entire text field to a different window.
  1. 选择要复制的最上面的元素。(要全部复制,请选择<html>
  2. 右键点击。
  3. 选择编辑为 HTML
  4. 带有 HTML 文本的新子窗口打开。
  5. 这是你的机会。按 CTRL+A/CTRL+C 并将整个文本字段复制到不同的窗口。

This is a hacky way, but it's the easiest way to do this.

这是一种hacky 方法,但它是最简单的方法。

回答by Vincent Tang

  1. Right click → copy → copy element
  1. 右键单击→复制→复制元素

enter image description here

在此处输入图片说明

回答by Pedro Reis

  1. Select the <html>tag in Elements.
  2. Do CTRL-C.
  3. Check if there is only lefting <!DOCTYPE html>before the <html>.
  1. <html>在元素中选择标签。
  2. 执行 CTRL-C。
  3. 检查<!DOCTYPE html>之前是否只剩下<html>.

回答by Udara Gunawardhana

using httrack software you can download all the website content in your local. httrack : http://www.httrack.com/

使用 httrack 软件,您可以在本地下载所有网站内容。httrack : http://www.httrack.com/