Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Need Help with a Spider Program saving Html Files

javawelljavawell Posts: 3Member
I need to know how to save web graphical elements, in the same manner that Internet Explorer saves a web page. I can save the html with no problem. One problem is how does a graphic locate itself on the page site side. The links i have seen do not reference a URL or directory structure. Most of the graphic links start with IMG.
Thank you--

Comments

  • zibadianzibadian Posts: 6,349Member
    : I need to know how to save web graphical elements, in the same manner that Internet Explorer saves a web page. I can save the html with no problem. One problem is how does a graphic locate itself on the page site side. The links i have seen do not reference a URL or directory structure. Most of the graphic links start with IMG.
    : Thank you--
    :
    All images on website are place by using the image tag. The src attribute gives you the location of the image, either absolute or relative. For more info on the image tag see www.w3schools.com.
  • javawelljavawell Posts: 3Member
    : : I need to know how to save web graphical elements, in the same manner that Internet Explorer saves a web page. I can save the html with no problem. One problem is how does a graphic locate itself on the page site side. The links i have seen do not reference a URL or directory structure. Most of the graphic links start with IMG.
    : : Thank you--
    : :
    : All images on website are place by using the image tag. The src attribute gives you the location of the image, either absolute or relative. For more info on the image tag see www.w3schools.com.
    :
    Can you explain the src attribute more or is there a site that explains it. Using java, how would I copy an image from an absolute location?
    Thank you--
  • zibadianzibadian Posts: 6,349Member
    : : : I need to know how to save web graphical elements, in the same manner that Internet Explorer saves a web page. I can save the html with no problem. One problem is how does a graphic locate itself on the page site side. The links i have seen do not reference a URL or directory structure. Most of the graphic links start with IMG.
    : : : Thank you--
    : : :
    : : All images on website are place by using the image tag. The src attribute gives you the location of the image, either absolute or relative. For more info on the image tag see www.w3schools.com.
    : :
    : Can you explain the src attribute more or is there a site that explains it. Using java, how would I copy an image from an absolute location?
    : Thank you--
    :
    This site explains it perfectly: http://www.w3schools.com./html/html_images.asp
    You can give an absolute URL in the src attribute:
    [code]
    image
    [/code]
    This will link the programmers heaven banner in the page.
  • amit9907amit9907 Posts: 3Member
    Hi,
    your posting indicates you are trying to create javabase browser in this context java.net.* or Java network programming would be an help to you as it provides option to save the entire page contents as html by opening a read write stream from the specified url.
    your problem of getting the image or graphics element is rather tricky
    if you read a img tag in the stream goto src attribute and try to stream the img file provided at it. Basically you have to work as java stream level to get the job done
    Pls refere to demo programs under swing section provided in JDK developement kit under demo directory there is a sample brower hope it will be a help to you.

    Bye
    Amit

Sign In or Register to comment.