Downloading Angular or ReactJS web pages - html

I need to write a parser which will collect data from a website which was developed using ReactJS. The problem is when open source code (Ctrl+U) I don't see anything in the code but if I inspect an element a can see full webpage in for instance google inspector (Ctrl+Shift+I)
Do you how can can download html code from the inspector?

I can not speak for React, but with angular if you locally host the site (ng serve) you will not be able to ctrl+u. However, if it's hosted somewhere you can ie: https://angular.io/

Related

convert html into pdf using nodejs

I am newbie in web development. I have a html page where there is some article having text and some pictures. I want to make the content of that html page into pdf and download it using "download as pdf" button. How can convert the html page into pdf and download that page using nodejs. A sample code or demonstration will be great help.
A general solution to what you are asking for is to use a headless browser, like PhantomJS, running on your backend to render the requested page, then export it as a PDF, before finally stream it to user's download request.
An example on how to render and export a webpage to PDF can be found here.

How to open a pdf on same page using pdf.js

I want to open up a pdf page on a web page on click of an icon and I want that page to be opened on the same page. I tried to use - pdf.js, but I am facing problem in running helloworld of pdf.js. So how do I use odf.js locally?
Link referred: https://github.com/mozilla/pdf.js/tree/master/examples/helloworld
Thanks
Probably not the issue you are experiencing but you will want to turn off web workers if you're using PDF.JS in multiple instances on the same page.
PDFJS.disableWorker = true;
it does not work with file://, you need to upload the files to your webserver, because AJAX just works with a webserver and not on the clientside

Embed web inspector console in a page

Is there any way to embed "console" tab from chrome web inspector in a page?
Unfortunately I do not know of a way to do this in a normal web page in any browser but you could make an Electron app and perhaps show the inspector whenever you want for the user.
If you are looking to embed a JS console emulator on your site, perhaps to show off raw JavaScript, you can use YourJS Console. It also gives you the ability to initialize the console with custom code or a GitHub Gist.

GWT - How can I see the HTML code?

Im using netbeans and the framework GWT. Due to the GWT structure, on my browser i can't see the html code with the simple "View Source". How can I see this? Im using Google Chrome.
Bye
View Source only shows you the HTML page that was downloaded (i.e., not much). Try using Chrome's Developer Tools to see the DOM structure after GWT's loaded. You can also use it to see network traffic from the page, and see JS errors if there are any.
I was faced with exactly the same situation. I use the Firefox extension Web Developer: on the "View Source" menu there is an option "View Generated Source".

Is there any way to communicate between my .exe application and Firefox?

Is there any way to communicate between my .exe application and Firefox?
Because, I have my own webpage. I'm using FireFox to browse it.
I have an application (in c++) to process a piece of HTML code from my webpage within FireFox. My application can print something directly to printer (raw print).
Since now, I coudn't access firefox's DOM content (page HTML source) from outside firefox; Also, I coudn't print directly to printer (raw print) from firefox.
Now, I'm looking solution for this problem. Here are my possibilities:
1.) My web page I can copy my related text to clipboard.
2.) My web page I can write my related text to Firefox's cookie.
3.) My web page I can write my related text to a file from client's PC.
4.) Any other way to send my related text to my .exe application.
But I don't know how can I do:
How can I copy to clipboard within firefox,
How can I read FireFox's cookie from my .exe application,
How can I create file in client's PC.
Is there any way to communicate between my .exe application (in c++) and Firefox?
You have to write an extension for firefox an use its API. For example see nsIProcess:
"The nsIProcess interface represents an executable process."
Assuming that your page has a true URL outside of FireFox, you could solve your problem by registering a custom protocol handler. E.g. register "X-myprettyprinter". Then, in FireFox, from http://www.example.com/index.html you can redirect to X-myprettyprinter:http%2D%2Dwww.example.com/index.html. FireFox doesn't know how to handle the X-myprettyprinter protocol so it hands off the URL to the OS, which then hands it to your registered application. Bonus: it works for all browsers. Downside: you have to retrieve the URL yourself and render the page again in-process
You could write an addon for firefox that allowed some form of integration with your application.
Here is a tutorial on writing firefox addins.
The best way to do this is to skip the .exe application and just make an ad on for FireFox, Take a look at the FireBug ad-on. It can pull certain codes out of a web page, If you use the API I bet you could do what your .exe program should.