搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

How to get the html from selected item without the mouse?

  • 7 个回答
  • 2 人有此问题
  • 2 次查看
  • 最后回复者为 Armagedoom

more options

I would like to be able to get the html from a selected item with hotkeys, but I find no way to do so.

So far, I do:

Select the item with a mouse-right click. Then press (Q) which opens the inspect element menu. Now, how could I 'copy the iner html' with hotkeys from there?

Thanks!

I would like to be able to get the html from a selected item with hotkeys, but I find no way to do so. So far, I do: Select the item with a mouse-right click. Then press (Q) which opens the inspect element menu. Now, how could I 'copy the iner html' with hotkeys from there? Thanks!

所有回复 (7)

more options

Ctrl+C and Ctrl+V ?

more options

Thanks for your reply, but I cant get it to work that way.

When you right-click anything in a website, then press (Q), your selection will still be on the website.

Im asking to copy the html. By using the mouse, you can just click in the white arrow in the grey popup that appears after pressing Q, then click "Copy outer html".

But with hotkeys, I find no way to select anything but the current website selection, so I cant select the html of the element to do a normal control+c / control v

more options

Hmmm,

If you use tab until the focus in inspect element and you press Ctrl+A(select all) then Ctrl+C Ctrl+V

由Diego Victor于修改

more options
more options

Thanks again: After reaching the inspect element by tabbing, control+a, control+c and control+v are not responsive. But that one doesnt deppend on reaching there by tabbing, it is the same as if I press around the area, I cant just control+c the code, I will need to right-click then 'copy outer html' in order to send it to the clipboard.

more options

@AliceWyman Thanks, yes, I read that before asking. It states there that the ways are to right-click and/or reach the context menu as we already discussed. But I was doubting there is no way to programatically (without having to manually right-click anywhere) get the html code?

I guess I will have to right-click then Q then left-click then 'copy iner html' every time :)

more options

I just tested, and in google chrome it works that way, when you inspect an element you can directly ctrl+c and you got the html, saving some valuable seconds and clicks if you are going to do that very often.