Results 1 to 20 of 20
  1. #1
    lordarnoud is offline Member
    Join Date
    May 2011
    Posts
    9
    Rep Power
    0

    Default Not sure how to name this title so i'll just use this, HELP!

    I am working on a project at the moment that has to show all the manga ( japanese strips ) from a webpage in a list in the application and when you select one of the manga it downloads it from the webpage in a folder and the application works as a reader as well so you can read the strips in the application. So i need something to get the information between the tags in the source of the webpage in my application and i need to find a way to download the images to my folder.

    The webpage has no API
    The images have random names

    -Arnoud

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Google HttpURLConnection.

  3. #3
    lordarnoud is offline Member
    Join Date
    May 2011
    Posts
    9
    Rep Power
    0

    Default

    But how can i use this? I don't see any methods that i can use to get to the HTML tags

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    That is to get the actual page data. Google for "Java Parse HTML".

    That (HttpURLConnection) is also, of course, what you will use to retreive the images from the img tag links.

  5. #5
    lordarnoud is offline Member
    Join Date
    May 2011
    Posts
    9
    Rep Power
    0

    Default

    Well i tried that and i came across Jericho and Jsoup and some others but i can't find what is it that i need to do to get the information from the site because most things are talking about connecting to the ftp or parsing a document but i don't have information to connect and we can't use an downloaded document because i want the program to be up-tp-date when you start it up

  6. #6
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Use HttpURLConnection to connect then one of those pakages to parse the document you receive from the connection. I did say you use that to retrieve a document, did I not?

  7. #7
    lordarnoud is offline Member
    Join Date
    May 2011
    Posts
    9
    Rep Power
    0

    Default

    Well you said i had to use that class but i could't find anything usefull in the API but maybe the thing with the packages works so i'll try that out :)

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,883
    Rep Power
    25

    Default

    Look at the javax.swing.text packages. It has classes for parsing HTML

  9. #9
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by lordarnoud View Post
    Well you said i had to use that class but i could't find anything usefull in the API but maybe the thing with the packages works so i'll try that out :)
    What? connect and getInputStream don't tell you anything? Then you, of course, use a Parser to parse the data you retrieve from the inputstream.

  10. #10
    lordarnoud is offline Member
    Join Date
    May 2011
    Posts
    9
    Rep Power
    0

    Default

    I didn't see the getInputStream method in the API( HttpURLConnection (Java 2 Platform SE v1.4.2) ) :| but thanks i'll see how far i can come with these hints :) will post a reply later if i get stuck again or if this solved it :)

  11. #11
    lordarnoud is offline Member
    Join Date
    May 2011
    Posts
    9
    Rep Power
    0

    Default

    I managed to get the html source in my console but i still can't download the image ? Any hints on how to download the image?

  12. #12
    lordarnoud is offline Member
    Join Date
    May 2011
    Posts
    9
    Rep Power
    0

    Default

    mmk found out how to show the image but still not how to save the image to a local folder :|

  13. #13
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    I'm sorry, but find another hobby, you are not cut out for this one.

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    So...you've managed to get hold of the image from the stream, and display it (in Swing?), but you can't figure out how to use that self-same stream to save it to a file?

  15. #15
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,883
    Rep Power
    25

    Default

    found out how to show the image but still not how to save the image
    Look at the ImageIO class. It has methods for writing images to disk.

  16. #16
    lordarnoud is offline Member
    Join Date
    May 2011
    Posts
    9
    Rep Power
    0

    Default

    @Tolls : Yes that's right :|
    @Norm : Thanks i'll try it out :)

  17. #17
    d3n1s is offline Member
    Join Date
    Apr 2011
    Posts
    69
    Rep Power
    0

    Default

    Quote Originally Posted by masijade View Post
    I'm sorry, but find another hobby, you are not cut out for this one.
    WOW, very helpful

  18. #18
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by d3n1s View Post
    WOW, very helpful
    What I am getting at is that any programmer should be able to solve at least the simple problems, but it doesn't look as though you are even willing to try solving your own problems.

  19. #19
    lordarnoud is offline Member
    Join Date
    May 2011
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by masijade View Post
    What I am getting at is that any programmer should be able to solve at least the simple problems, but it doesn't look as though you are even willing to try solving your own problems.
    Well believe it or not but i actually spend a lot of time in finding this but it just seemed like i kept missing the answer :| and i would spend more time looking for it but the deadline is in a week :|

  20. #20
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by lordarnoud View Post
    Well believe it or not but i actually spend a lot of time in finding this but it just seemed like i kept missing the answer :| and i would spend more time looking for it but the deadline is in a week :|
    Then, and again, i'm sorry, but you need to improve your research skills.

Similar Threads

  1. How to rename GUI Title
    By rjagan in forum New To Java
    Replies: 5
    Last Post: 06-11-2014, 12:51 PM
  2. Title not displayer
    By weezy2894 in forum Java Applets
    Replies: 13
    Last Post: 04-18-2011, 05:12 AM
  3. Change the title
    By AndrewSD in forum NetBeans
    Replies: 1
    Last Post: 01-11-2011, 04:23 AM
  4. set * at tab title
    By keffie91 in forum Advanced Java
    Replies: 7
    Last Post: 10-06-2008, 08:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •