Loading & parsing a web page

P

Peter Wu

In the web page, it has dynamic link which product jpg pictures, how I
can load the whole web page with the picture, in which the picture does
not even have filename.

Thanks..
 
P

Paul Lutus

Peter said:
In the web page, it has dynamic link which product jpg pictures, how I
can load the whole web page with the picture, in which the picture does
not even have filename.

Find the URL in the original page that produced the JPEG image, sumbit the
URL to URLConnection, read the image.

Why not tell us the specific page address so we can determine how feasible
this is?
 
A

Andrew Thompson

A

Alex Kizub

Not everything is Java, guys.
It could be JavaScript which creates image url...
In this case Java is helples...

Alex Kizub..
 
P

Paul Lutus

Alex said:
Not everything is Java, guys.

Except that is the newsgroup's topic.
It could be JavaScript which creates image url...

Once the URL is known, Java can capture the image. JavaScript is certainly
not creating the image.
In this case Java is helples...

Utter nonsense, even when spelled correctly.
 
A

Alex Kizub

Once the URL is known, Java can capture the image. JavaScript is certainly
not creating the image.
But it does create the url! And there is only one way to obtain this url - run
JavaScript.
It bothers me too but there is no way in Java to do it.
Of course there are some oportunites like http://jwebunit.sourceforge.net/ but
it's not so easy.
That's what I mean by
Not everything is Java, guys.
Alex Kizub.
 
P

Paul Lutus

Alex said:
But it does create the url! And there is only one way to obtain this url -
run JavaScript.

As you can see above, my suggestion was to capture the URL from a browser,
then do the download in Java.
It bothers me too but there is no way in Java to do it.

Nonsense. Re-read the original poster's message. He wants to download a JPEG
image using Java. Either that or he has posted in the wrong newsgroup.
 
M

marcus

URL's in html documents are sometimes relative. If the image tag says
src="mypic.jpg" then the image might reside at
"http://www.coolsite.com/mypic.jpg"

Or it might not. It might be coming out of a database and only look
like it is coming from that file on the server. Or the sysadmin might
prevent attempts to download the image directly without being
referrenced by the page (has to do with http headers).

You do know downloading copyrighted images (virtually all of them) is
stealing, right? this is an academic excercise?

-- clh

Alex said:
Once the URL is known, Java can capture the image. JavaScript is certainly
not creating the image.

But it does create the url! And there is only one way to obtain this url - run
JavaScript.
It bothers me too but there is no way in Java to do it.
Of course there are some oportunites like http://jwebunit.sourceforge.net/ but
it's not so easy.
That's what I mean by
Not everything is Java, guys.

Alex Kizub.

Paul Lutus wrote:
 
A

Alex Kizub

Nonsense. Re-read the original poster's message. He wants to download a JPEG
image using Java. Either that or he has posted in the wrong newsgroup. You are right. Let's see:
In the web page, it has dynamic link which product jpg pictures, how I
can load the whole web page with the picture, in which the picture
____does not even have filename____.

It definitely means that img is driven by JavaScript.
There are so many examples in the web. See http://www.nationwide.com
How can you download image of car? or broken car? You should run
JavaScript to obtain img source/url. And then you can use Java to
download choosen image.

BTW. Sorry for wrong url for Java supporting JavaScript. It should be
http://www.httpunit.org/

Alex Kizub.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top