html dynamic change - how view changed contents? - html

Javascript run at page opening or later by user action like clicking a button with javascript attached, can alter the page contents and for instance change the layout in the browser.
Using right-click "View Source" shows the original content, not the changed one.
But how/from where can one retrieve the new, changed page contents?

You could use Firebug to see the live contents of the DOM, or you could use Web Developer's view generated source feature.

Related

How to view HTML source without refreshing the page in Chrome

I need to view all source HTML in plain text in one place. I need it from an already loaded page. CTRL+U (View Source) refreshes the page. The page I'm trying to view can only be accessed via proper form submit. What I really want is for CTRL+U to not refresh the page.
I need the HTML source of an already loaded page added to my clipboard.
I think none of the other answers really answer your question.
You want the exact response from the server, not the current DOM, and you want it with the exact request headers that was sent the first time.
To do so, open the Chrome Dev Tools and select the "Network" tab.
The very first request should be the page you requested. Click it and select the tab "Response" on the right side to get the exact response the server gave you.
Right click-> inspect element anywhere you want to see the html, it still show the code of all the page ans you can modify the value of html/css directly in it.
The only answer is the one Dor1000 provided himself in a comment:
dev tools, elements tab, right click html tag, copy, copy outer html.
He wants the current HTML (after javascript or any other modifications, not the original source HTML).

How to edit WordPress page's html code

I can't get editable html code behind the page. I want to make some changes to the page. Web site is hosted in the remote server. Someone assigned this task. There is empty editor when open edit page as below image.
Also I added plugin and actived it but can't get the result.
The picture you posted is of the WYSIWYG editor, which is only for adding content to the page.
If you want to edit the layout of the page itself you have 2 options -
Minor page edits to appear across all pages on the site - Go to Appearance -> editor -> page.php and then edit the code to suite your needs.
Large page edits to appear on one or two pages -
Get access to the files
Duplicate page.php with a different name
Edit code
When you go to add a new page you should have an option to pick a page template. Choose the page template you just created.
If you know exactly what you are doing, you can use Chrome "Inspect" feature, and change the HTML of the content inside the WordPress WYSIWYG Editor. After injecting your HTML, click Preview or Publish and your changes will be saved correctly.
In WordPress 5.5.3, you should be able to click the three dots on the top right, then select Code editor. Alternatively, press Ctrl+Shift+Alt+M.

data not loaded fully in HTML

I am trying to create a scraper using vb6, my technique is to search the html page with get between 2 text function.
the function is tested and working correctly for all the sites, except a new site that I tried to use the same technique with it and failed.
The problem is the html is not showing the data, piece of the html as below:
<tr>
<td valign="top" nowrap="nowrap" class="label">Company Name:</td>
<td><span class="search-custom" id="synopsisDetailsOppNum"></span></td>
</tr>
the value should appear between the span tag above, but it's not appeared inside the HTML as above code.
The website is using javascript to manage the data.
I have tried also to use wait function, may the data appear with the HTML, but failed too.
Is there any solution to get the value, even with vb.net as I can update my code
that website is using JavaScript to add data to the webpage and such manipulation will not show up on the page source
The follwoing is quoted from JavaScript & jQuery: The Missing Manual by David Sawyer McFarland
One problem with using JavaScript to manipulate the DOM by adding,
changing, deleting, and rearranging HTML code is that it’s hard to
figure out what the HTML of a page looks like when JavaScript is
finished. For example, the View Source command available in every
browser only shows the web page file as it was downloaded from the web
server. In other words, you see the HTML before it was changed by
JavaScript, which can make it very hard to figure out if the
JavaScript you’re writing is really producing the HTML you’re after.
For example, if you could see what the HTML of your page looks like
after your JavaScript adds 10 error messages to a form page, or after
your JavaScript program creates an elaborate pop-up dialog box
complete with text and form fields, it would be a lot easier to see if
you’re ending up with the HTML you want. Fortunately, most major
browsers offer a set of developer tools that let you view the rendered
HTML—the HTML that the browser displays after JavaScript has done its
magic. Usually the tools appear as a pane at the bottom of the browser
window, below the web page. Different tabs let you access JavaScript
code, HTML, CSS, and other useful resources. The exact name of the tab
and method for turning on the tools panel varies from browser to
browser: • In Firefox, install the Firebug plug-in (discussed on page
477). Open a page with the JavaScript code you wish to see and open
Firebug (Tools→Firebug→Open Firebug). Click the HTML tab in the
Firebug panel, and you’ll see the complete DOM (including any HTML
generated by JavaScript). Alternatively, you can use the Web Developer
toolbar in Firefox to view
both the regular HTML source, and the generated HTML. • In IE 9, press
the F12 key to open the Developer Tools panel, then click the HTML tab
to see the page’s HTML. In the case of IE9, the HTML tab starts by
showing the downloaded HTML (the same as the View Source command). But
if you click the refresh icon (or press F5), the HTML tab shows the
rendered HTML complete with any JavaScript-created changes. • In
Chrome, select View→Developer→Developer Tools and click the Elements
tab in the panel at the bottom of the browser window. • In Safari,
make sure the Developer menu is on (choose Safari→Preferences, click
the Advanced button, and make sure the “Show Develop menu in menu bar”
is checked. Then open the page you’re interested in looking at, and
choose Develop→Show Web Inspector. Click the Elements tab in the panel
that appears at the bottom of the browser window. • In Opera, choose
Tools→Advanced→Opera Dragonfly. (Dragonfly is the name of Opera’s
built-in set of developer tools.) In the panel that appears at the
bottom of the browser window, click the Documents tab.
so the scraper won't download the page after the JavaScript finished it will get what it looks before any the JavaScript manipulation
you can watch Michael Schrenk talking about Screen Scraper Tricks: Extracting Data from Difficult Websites
http://www.youtube.com/watch?v=NtffxCi8aq4

Getting the generated sourcecode of a page in notepad

Is there any way of getting the source code of an HTML browser-page that is showing when i click inspect element(in chrome of firefox) and put it in a notepad(automatically) or maybe accessing it automatically somehow.
I do not want the original sourcecode but the one that is generated after all the javascripts have already run.
I would like to use the code afterwards in another web page and parse it...
later edit: i can actually click the html in the inspect element and click copy html but i need for a nother site to automatically acces this information because i will try reloading the site at regular intervals and need to constantly get the new html
With Firebug's HTML tab, you can right click on the element, and click "Copy HTML".
See also this post:
how to get fully computed HTML (instead of source HTML)?
press ctrl+u then it will display source code of html page then go to file menu and save it as html file in your system. then you can open it in html or another editor like netbeans /dreamviewer/notepad. I suggest you to open it in netbeans or dreamviewer will be better then open it in notped.
thanks.
You can use the web developer plugin for Firefox or Chrome. It gives you the generated source of a page.
In Opera , Right Click -> click on Inspect Element -> right click on <html> tag -> click on Edit Markup, from there you can copy the entire HTML code.
Edit -> In Oprea, right click on the page -> click on Source -> a new tab opens , in the menu bar of newly opened tab you have option 'Save' , from that option you can save the html code as .html , .txt.
Hope this helps you.

Get code source of dynamically loaded HTML content (Chrome/Gmail)

I am trying to access the HTML code source of AJAX dynamically loaded content. How could I do it?
For example on Gmail, I am trying to access the HTML code of a given email discussion's content (the different entries of a given email discussion) which is loaded only when I click on this email discussion's line in the main list. The code source I can access is only the one of the page initially loaded (the list of all email discussions). Any idea?
Right-click on the page and select "Inspect Element". The element view is updated when JavaScript makes changes to the page, whereas the "View Source" view only shows content from when the page was loaded.
If you right click -> "View Source", it will show you the contents of a reloaded version of the page you are on.
Using "Inspect element" (hotkey CTRL+SHIFT+i) in Chrome shows the source of the dynamic content.
I think you want to bind event on the dom element that loaded after initial page load using ajax. If so then you can use jQuery library and you can use live method of jquery.
Here is a link for live method, you can check that.
http://api.jquery.com/live/
What you need
Download jquery latest library (http://docs.jquery.com/Downloading_jQuery)
and then include it in script within head
or you can use cdn http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
then do like following
<script>
$(document).ready(function(){
$("#ajax_dom_element_id").live('click_or_any_event',function(){
code snippet you wan dot
});
});
</script>
I think it will be helpfull.