How to download images from html page that uses javascript [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I do program to parse html pages and store images. But I ran into a problem. This page is dynamically generated by JavaScript, it means when I download the source code of the page and there are links to pictures. Can you please advise how to bypass it? Alternatively, some příkalad to be in Java. thank you
Downloading page:
http://www.lide.cz/detail/j0YbgS6Xp7AoMAOP

That is not as easy as it seems to be at first glance. You need a headless browser engine like PhantomJS or the like that runs the Javascript and returns you the generated HTML.
See this answer to get more information on that topic.

Related

Playframework Render Javadocs [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I need to render an entire javadocs filestructure which is in plain html.
I need this to render the files using permissions. The user needs to be logged in in order to view the files.
I got a folder with .js .html and some other folders as well. I need these to be viewed by a user, but only if this user is logged in.
How do I allow Play! to return a set of these specific files, without having to modify them?
Googled quite a lot but to no avail.
Thanks in advance
You would have to create your own version of the assets controller that will enforce the auth-requirement, you could probably get it to work by just wrapping the built in Assets controller. If the javadoc is not packaged with play you could take a look at the ExternalAssets controller which can server arbitrary files from the filesystem.
If you do not already have a play app that you are including this in it would probably be easier to do this with a webserver, apache would for example allow you to do this with only configuration.

Running simple website through Jar file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I am trying to run simple static website through Jar file but not having too much luck.
The reason I want to run the website through Jar because I don't want end users to access my pages directly. For example, they should not have access to index.html page directly without actually starting my program which is built using java swing.
Things I tried:
Jar application works if I am running on the same machine where I created Jar using Eclipse because index.html page is fetching the page from local directory. which i know is wrong.
If I try using different laptop or desktop then my swing application does not open any kind of index.html through my browser.
So any suggestions?
Also, I was using Desktop.open(), Desktop.browse, getClass().getResources().getURL() .. stuff that I seen on other pages.
You need to copy your data or use a server like tomcat, jboss etc.

Any way to pull information from this website [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I wanted to know how to pull the menus dynamically from this website without having to hardcode the links to each month's menu every time the month changes. I'm trying to implement this on an android application, so code in Java would be very helpful
This is the website where I want to pull the menus from (Link)
Can someone provide me with an example of how one would do this?
In this url:
http://www.schoolnutritionandfitness.com/index.php?page=menus&sm=6&sy=2013&sid=0608121745464795
sm param seems to be month
sy obiouslly year
Use jsoup to get the data you want from the dates you need making up url.
Answering your comment: refer to http://jsoup.org/ then you can make more specific questions further!!

How to scrape ajax loaded content with jsoup [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have used JSOUP for scraping and its works perfectly till the ajax and javascript not playing their roles to display webpage content .
Now guys any clue , how to scrape those content which get displayed with ajax or by JavaScript after page get loads completely .
Thanks in advance !!
You can use a headless browser as PhatomJS.
PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.
In order to ease your work, You could use CapserJS
CasperJS is a companion for PhatomJS which brings a greatly improved API to ease the creation of scraping and automation workflows.
These tools are very useful when you have to scrape a websites with dynamic content, for instance, websites where the content is displayed after it ran process in Javascript (sometimes including ajax calls).
You can see a example about how casper works here:
CasperJs and Jquery with chained Selects
You can't do it directly with JSoup. You'll need a headless browser, which is a much more complex thing. There are headless versions of Firefox, Safari, and others. Searches for "headless X" (where X is the browser engine you want to use) should turn up some useful projects.

Is Google Chart Tool Api is free to use [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
Is Google Chart API free to use? If so, where can I find its documentation?
Yes, it is free. It is written in the official page:
Completely free for all uses:
commercial, governmental, personal or
educational.
For documentation follow this link.
Edit:
You don't really download it. You include the following in your code:
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
Then you start using it as shown here.
If you really want to see how it looks like inside, you can paste this to your browser address bar: http://www.google.com/jsapi
its completely free. You can check the different chart from below link
http://code.google.com/apis/ajax/playground/?type=visualization

Categories