Copying HTML code in Google Chrome's inspect element - html

I have a website of which 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?

Do the following:
Select the top most element, you want to copy. (To copy all, select <html>)
Right click.
Select Edit as HTML
New sub-window opens up with the HTML text.
This is your chance. Press CTRL+A/CTRL+C and copy the entire text field to a different window.
it's the easiest way to do this.

Right click → copy → copy element

Select the <html> tag in Elements.
Do CTRL-C.
Check if there is only lefting <!DOCTYPE html> before the <html>.

Using HTTrack software you can download all the website content to your local directory.
HTTrack: http://www.httrack.com/

This is bit tricky
Now a days most of website new techniques to save websites from scraping
1st Technique
Ctrl+U this will show you Page Source
2nd Technique
This one is small hack if the website has ajax like functionality.
Just Hover the mouse key on inspect element untill whole screen becomes just right click then and copy element
That's it you are good to go.

Related

How to show completed html source on chrome?

I'm trying to take the full html source of the tab in
this page
I want to take the source of
this tab
But unfortunately, the html I'm getting is not completed.
I registered a gif to explain it better
That select list is showing just when I inspect the element, while If I just insect the element with the list closed, it doesn't return any list html.. is it created dinamically when the user click on it?
I've tried to expand all the codes, but unfortunately it seems the html of every list is not appearing.. It might be created just when I open the list?
Is there a way to get the lists html?
Hope I've been clear.
Not sure what you want to save, but by inspecting it sources, it seems that the website use the way of removing and appending the html source which means only you pressed the expanded button, Javascript will append it (different options) to the body, otherwise it will not shown in the element tab.
I don't think you could get all html tags in just 1 try because the website use Javascript to append the html and you can't see it in the element section in console when the element is being removed.
Example:
You can save the page if you want. Just save it with Ctrl+S and you will find the basic source in there along with the stylesheet and other scripts.

How to always add style in one site

I use a site at work that has unordered list "ul" with a lot of "li" elements without borders, I would like to always highlight the "li" elements to have better readability.
What I do at this moment is right click the page and open the inspector and add this line:
<style>li:hover {background-color: #ffff99;}</style>
It works but I'm wonder if I can do a plugin for this or if there is another way to do it automatically (I have already send a request to the developer of the site to request this change but while I wait I would like to know what would be the best approach to automate this task)
The list look like this:
File.txt 85215165
File2.txt 96312121
File3.txt 41212123
File4.txt 65623443
File5.txt 69532055
... and so on
(It's not a continuous string, the file name and the number are elements inside the one "li" element and I'm not able to select them at the same time with the mouse)
And it has no style so it's difficult (at least for me) to see which number in the right match the file name in the left.
Note: The list is generated with a script and when I try to see the code of the page (right click see source code) I don't see it, I just see the script, that's why I do it with the inspector
This may solve the issue:
Stylish or Stylebot -- Chrome plugins -- both seem to add your preferred CSS on top of the specific websites you choose.
Paste this in the browser console, slightly faster and easier than editing HTML tags from within the tree in the inspect element tab.
document.head.insertAdjacentHTML("beforeend", `<style>li:hover {background-color: #ffff99;}</style>`)

How can I select the texts on this page?

I'm not sure if this is the right place to ask this. But how would one go about selecting text on this page (I'm trying to copy and paste to a dictionary online).
http://novel.naver.com/best/detail.nhn?novelId=189212&volumeNo=1
Thanks for any help.
You shuld find the node you need (paragraph with text) in the DOM tree and copy it. Use DOM inspector (ctrl+shift+K in Mozzila or `ctrl+shift+I in Chrome -> choose DOM inspector).
Using Chrome's web developer tools and Javascript turned off, simply right-click->Inspect element now in the Elements tab of the Inspector select the <head></head> tag and right-click->Delete Node, now the text will be highlight-able.

copy and paste code from safari (chrome) web inspector

I want to copy some html code from the web inspector but am only able to copy one line at a time. Is there any way to select a block of elements or all elements?
If you right click on any element in the Web Inspector, then click "Copy as HTML" on the resulting pop-up menu, you can then paste the html for that element (and all enclosed elements) into your editor. You can get the entire document by doing this with the <html> element.
On the console, try document.documentElement.outerHTML.
You could view the html response from the Network section of Chrome

Make a web toolbar load on any webpage

I've created a toolbar in html that I need to be able to load of any given webpage; I'm thinking of loading it on the page through the use of a bookmarklet but I can't quite get my head around how I go about doing it.
An example of what a need to happen is as follows.
I navigate to any webpage on the internet, I click the bookmark for my toolbar and it appears at the bottom of the page without affecting any of the content on the page, it will stay fixed even when scrolling.
I've added a picture of how the toolbar will look, any suggestions on how I can implement the required functionality?
http://d.pr/bVeM
Many Thanks
What you will need to do is use CSS to keep it at the bottom. Basically you stick your toolbar html code in a <div> tag and then use CSS to keep it at the bottom. Try reading this link or this link on how to do it
Create a script file that you can host somewhere (if it's just for you, you can use localhost). In that script build the toolbar. Your bookmarklet will look something like this:
javascript: document.body.appendChild(document.createElement("script"))
.src = "http://myserver/myscript.js"; void 0;
It wraps here for readability. It won't wrap in your bookmarklet.
The javascript: tells the browser you are executing a script. The void 0 at the end prevents the page from navigating to the return value of the JavaScript.