Download web page html source after being processed by javascript - javascript

I was trying to scrap a page so i downloaded the html source code but then i found that most of the links leading to images and other stuff doesn't appear in the code so i inspect in chrome and found the links
I searched alot for this topic and found phantomjs but it is deprecated now so is there any alternative

Related

can't stop obsolete version of XML file from loading on web page

I have some generic javascript that loads and displays photos on an html page based on an xml file that it reads. The problem is that if I change the content of the xml file, it doesn't show up on the web page. Here's a section of an xml file to give you an idea of what I'm talking about:
<slides>
<slide>
<name>slideshow/cal2018/20180506.jpeg</name>
<alt>some alt text</alt>
...
The problem that triggered my issue is I decided to move the "slideshow/" into the xml file instead of having it in the javascript. When I did that, the photos stopped showing up - I just got the alt text. However when I switched to a different page, the photos were brought up properly.
The problem is that all the web browsers seem to want to hold on to xml files for a long time - apparently at least a week, which is how long I worked on the pages without the current version of the xml file being loaded.
I can manually clear the browser cache and the problem resolves itself for that browser. Simply reloading the page, which is sufficient to reload the javascript, doesn't do that.
I use a lot of xml files to drive web pages. I need to ensure that the xml file is the current one and not some ancient cached copy. Is there a cross-browser (javascript?) way I can clear the (xml) cache before loading an xml file?
Also, why do browsers ignore xml files when I ask for a page reload?

How To Detect Which Javascript Code is Causing the Page Redirection?

I am using a template downloaded from the internet which is completely free but the website from where i downloaded has added a link back to its homepage at the footer of the template. When i try to remove that particular link, my page redirects to its homepage URL.
How do i know which code is causing the page redirection?
I have already tried searching for its homepage URL in the source code, but i didn't find that. Can i monitor the JavaScript activities? If so how?
I also tried looking for third-party script linked to the document, unfortunately there are so many documents linked which makes it even harder to figure out the actual script.
Assuming there's a window.location.replace or window.location.href somewhere, try inspecting the page, switch off your internet connection and grab the error line from your Console or Network tab. It worked for me using Firefox Developer Tools.

Why I can't see .js files in Sources tab in google chrome developer tools when I use jquery method $.getScript()?

I can see every js file in Sources tab in google chrome developer tools when I use tag in html file to include js file, but when I use jquery method $.getScript() to load js file, I cann't see it in Sources tab in google chrome developer tools anymore, why? I have searched other similar questions in stackoverflow, but none of them give a clear answer.

Using a Chrome extension, how to get page source and save to a local file?

I'm new to Chrome extensions, and don't need a lot from an extension, so I haven't studied JS or the HTML5 Chrome API in great detail (however, I do know HTML). Other pages in Stackoverflow were not quite what I was looking for.
Basically, I am writing a program that will take HTML page source data and parse certain information out of it for use with another program. What I need to be able to do is use a Chrome extension to get the source of a web page, then save it to a local HTML file for the program to use.
I'm using most of the extension source code from this thread: Getting the source HTML of the current page from chrome extension
This works very well, except I need the source to go to a local file and not in the popup. In the popup, I'm going to add in a message like "File saved" along with a button to open the external program (if that's even possible). Any help or a step in the right direction would be greatly appreciated.

Javascript file reference in debugger missing

I am not exactly certain what I did to cause this, but I have been able to, up until a couple of minutes ago,debug my javaScript file(referenced using a script tag in a .aspx page I am working with) using FireFox firebug tools. Suddenly, I am unable to view the file via the FireFox script tab list. I scroll the list of script files included in my page, but I do not see the particular Javascript file I expect to be on the list. I am however, able to confirm that the JavaScript file is loaded along with the page information, under the HTML tag in firefox.
**No Javascript on this page**
If <script> tags have a "type" attribute, it should equal "text/javascript" or "application/javascript". Also scripts must be parsable (syntactically correct).
I experience similar problem when using chrome. When I pull up the entirely loaded file, I am able to confirm that my javaScript file is correctly referenced. But for some reason I am unable to verify the script is being run or debug it.
The rest of the web application works file. Problem is just with the one page.
ONE SOLUTION
I created a new aspx file. Copied over the code from the faulty page and ran it, and it worked fine on both Firefox and chrome.

Categories