How to save webpages through JSLHow can I save webpages from JSL? I use the following lines of code to open the webpage in a JSL
url = "https://www.nytimes.com";
w = New Window( "s1",wb = Web Browser Box(url ), wb << Set Size( 1200, 1200 ););
w << Set Window Size( 1200, 1200 );
Thereon, what can I do to save the webpage with full graphics in a form that can be consumed later (pdf or full graphic html)? I essentially need to do this for a few hundred internal URLs for a database for visualization that is being turned off.
Re: How to save webpages through JSLYou may be able to use Run Program() to launch Python to accomplish this in JMP 12. There's a good paper from Discovery Summit Europe 2016 with good examples for how to use Run Program.
However, JMP 14 is a complimentary upgrade for users with an Annual License. You should speak to your license administrator about getting JMP 14. If you don't know who that is send me a private message and I'll be able to assist you.
Re: How to save webpages through JSLThanks @Jeff_Perkinson .Is there any other option to save html as pdf in jmp12?
Re: How to save webpages through JSLNo, JMP 12 does not have support for connecting to Python. You’ll need to upgrade to the current release of JMP, JMP 14 to connect to Python.
Re: How to save webpages through JSLI am trying to save html as pdf.Tried running this code but Python Connect() does not work for me.
I am using JMP12.Is this not supportable for this version of JMP?
Thanks
Re: How to save webpages through JSLJMP may not be the best tool for that specific part of the job - saving a web page as a PDF file.
However, I found the pdfkit library for Python which means you can do it from JMP using the Python interface.
Something like this:
URLs = {"https://jmp.com", "https://community.jmp.com"};
py = Python Connect();
For( i = 1, i <= N Items( URLs ), i++,
pdf = "C:\TEMP\" || Substitute( Word( 2, URLs[i], "/" ), ".", "" ) || ".pdf";
py << submit(
Eval Insert( "import pdfkit; pdfkit.from_url('^URLs[i]^', '^pdf^')" )
);
);
One hiccup to note: pdfkit is a wrapper for wkhtmltopdf so you'll need to install that also.
Re: How to save webpages through JSLThanks Jim for your response. Do you have any alternate suggestions on how to save webpages as pdfs through JMP? I encountered similar issues as above with saving as journal files or htmls.
Re: How to save webpages through JSLI could not find a way to save a Web Box() object to a PDF......maybe another community member can determine a method
Re: How to save webpages through JSLThanks txnelson. I am trying to save the webpages as pdfs. However, I just get void files saved when I run something like this below:
url = "http://nytimes.com";
w = New Window( "s1", wb = Web Browser Box());
w << Set window size (1200,1200);
wb << set auto stretching (1,1);
w << set auto stretching (1,1);
wb << Set Max Size( 1200, 1200 );
wb << navigate (url);
wait(2);
wb << select << save pdf ("$Documents\tst.pdf"); It feels like I am something really obvious in how I am trying to save the web browser box object.
Re: How to save webpages through JSLJMP allows you to generate JMP output and then save that output to either HTML or Interactive HTML. You can generate a JMP Journal that will allow you to bring in various pieces of output from different graphical and statistical JMP platforms, and then save it to HTML.
If what you want to do, is to build raw HTML code into webpages, then the only way that I know of how to do that in JMP would be to place all of the HTML code into a string variable and then use the Save Text File() function to save the HTML generated code to a file.
Re: How to save webpages through JSLBumping