We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › ProHTML Parsing
Page Index Toggle Pages: 1
ProHTML Parsing (Read 1487 times)
ProHTML Parsing
Feb 12th, 2007, 8:22pm
 
I'm using proHTML to do some data collecting for a visualization.  I got the 'getImageLink' stuff down to pull down images, but now I am a bit stuck on how to get the "http://www.blah.com" out of the following element "whatever" element... possible?

<a href="http://www.blah.com" id="whatever">ummmm</a>


Many thanks!
Re: ProHTML Parsing
Reply #1 - Feb 12th, 2007, 8:41pm
 
i don't really know proHTML, but this should do the job i guess:

http://www.texone.org/prohtml/htmlelement_method_getattribute.htm
or
http://www.texone.org/prohtml/standaloneelement_method_getattribute.htm

String href = YourElement.getAttribute("href");

F
Re: ProHTML Parsing
Reply #2 - Feb 12th, 2007, 10:04pm
 
Actually, I think I could use getLinks... but the demo code breaks at:

ArrayList links = htmlList.getLinks();

The type of the right sub-expression, "java.util.List", is not assignable to the variable, of type "java.util.ArrayList".

Anyone know if anything changed in Processing where this would break?  I assume it worked at one point?  Getting in touch with texone hasn't been succesful...

Many thanks...
Re: ProHTML Parsing
Reply #3 - Feb 12th, 2007, 10:30pm
 
I've not tried proHTML, but you could try:

ArrayList links=new ArrayList(htmlList.getLinks());
Re: ProHTML Parsing
Reply #4 - Feb 12th, 2007, 11:52pm
 
or just try:

java.util.List links = htmlList.getLinks();

works with the "HtmlList_getLinks" example.

F
Re: ProHTML Parsing
Reply #5 - Feb 14th, 2007, 10:17pm
 
Right on.. many thanks!
Page Index Toggle Pages: 1