• Post Reply Bookmark Topic Watch Topic
  • New Topic

!!display image file locations of webpage in a textArea !!  RSS feed

 
b downe
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i wanted to create an application that listed the image file locations of a web page. possibly a user could input the url in an input box?
Invisioned the list would be collected in an array and displayed in a TextArea..
But not entirley sure where to start... Could anyone help?
 
Ben Wood
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I imagine you would want to start off by connecting to the URL and reading the contents...

You need to parse the input (inputLine) in some way to strip out the IMG information. I would work through the HTML input and if there is a match for "<IMG", read in to a separate String variable until the next "/>". Then strip out the SRC url from the String and stick it into either an array of Strings (although you will not know how many images you will find, so you will need to condier how big the array needs to be), or perhaps add String objects to a Vector or a List.
Now you can loop over the array or iterate over the Vector/List and print out the contents into your TextArea using append().
hope this helps you get started
[ March 31, 2004: Message edited by: Ben Wood ]
 
b downe
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, will try it out!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!