You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(5) |
Feb
(13) |
Mar
(7) |
Apr
(23) |
May
(1) |
Jun
(1) |
Jul
(10) |
Aug
(2) |
Sep
(6) |
Oct
(6) |
Nov
|
Dec
(7) |
2009 |
Jan
(4) |
Feb
(2) |
Mar
|
Apr
(6) |
May
(8) |
Jun
|
Jul
(5) |
Aug
(5) |
Sep
(2) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2010 |
Jan
(12) |
Feb
(5) |
Mar
|
Apr
(4) |
May
(22) |
Jun
(3) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
(2) |
2011 |
Jan
(10) |
Feb
|
Mar
(4) |
Apr
(2) |
May
|
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(1) |
Oct
|
Nov
|
Dec
(3) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(2) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Neera S. <nee...@gm...> - 2011-01-27 19:36:19
|
Hi Jake, Thanks for looking into it. Here is the code snippet - org.cyberneko.html.parsers.DOMParser parser = new org.cyberneko.html.parsers.DOMParser(); parser.setFeature("http://cyberneko.org/html/features/augmentations", true); parser.setProperty("http://cyberneko.org/html/properties/names/elems", "lower"); parser.parse(url); Document document = parser.getDocument(); DOMReader reader = new DOMReader(); org.dom4j.Document doc = reader.read(document); DOMWriter writer = new DOMWriter(); return writer.write(doc); Neera On Thu, Jan 27, 2011 at 6:51 AM, Jacob Kjome <ho...@vi...> wrote: > > It appears to me that the parser being used is DOM4j, not NekoHTML. DOM4j is > an XML parser, not an HTML parser. Please provide a snippet of code showing > how you are engaging the parser. > > Jake > > On Thu, 27 Jan 2011 11:11:57 +0100 > Marc Guillemot <mgu...@ya...> wrote: >> Hi, >> >> please reduce the html content to the minimum allowing to reproduce the >> problem and open an issue. >> >> Cheers, >> Marc. >> -- >> HtmlUnit support & consulting from the source >> Blog: http://mguillem.wordpress.com >> >> >> Le 27/01/2011 00:44, Neera Sharma a écrit : >>> Hi All, >>> >>> I am trying to use DOM parser to parse the following URL >>> http://www.helloneighbour.com/save/city-movers-and-transports-trucking-and-freight-mississauga >>> >>> with the following parser settings - >>> parser.setFeature("http://cyberneko.org/html/features/augmentations", >>>true); >>> parser.setProperty("http://cyberneko.org/html/properties/names/elems", >>> "lower"); >>> >>> I am running into the following namespace error >>> >>> org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create >>> or change an object in a way which is incorrect with regard to >>> namespaces. >>> >>> at org.apache.xerces.dom.CoreDocumentImpl?.checkNamespaceWF(Unknown Source) >>> at org.apache.xerces.dom.ElementNSImpl.setName(Unknown Source) >>> at org.apache.xerces.dom.ElementNSImpl.<init>(Unknown Source) >>> at org.apache.xerces.dom.CoreDocumentImpl?.createElementNS(Unknown Source) >>> at org.dom4j.io.DOMWriter.appendDOMTree(DOMWriter.java:181) >>> at org.dom4j.io.DOMWriter.appendDOMTree(DOMWriter.java:158) >>> ----- >>> ----- >>> >>> I would really appreciate any help that you can provide to resolve the >>>issue. >>> >>> >>> Thanks, >>> Neera >>> >> >> ------------------------------------------------------------------------------ >> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! >>Finally, a world-class log management solution at an even better price-free! >> Download using promo code Free_Logger_4_Dev2Dev. Offer expires >>February 28th, so secure your free ArcSight Logger TODAY! >> http://p.sf.net/sfu/arcsight-sfd2d >> _______________________________________________ >> nekohtml-user mailing list >> nek...@li... >> https://lists.sourceforge.net/lists/listinfo/nekohtml-user >> > > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > nekohtml-user mailing list > nek...@li... > https://lists.sourceforge.net/lists/listinfo/nekohtml-user > |
From: Jacob K. <ho...@vi...> - 2011-01-27 15:52:01
|
It appears to me that the parser being used is DOM4j, not NekoHTML. DOM4j is an XML parser, not an HTML parser. Please provide a snippet of code showing how you are engaging the parser. Jake On Thu, 27 Jan 2011 11:11:57 +0100 Marc Guillemot <mgu...@ya...> wrote: > Hi, > > please reduce the html content to the minimum allowing to reproduce the > problem and open an issue. > > Cheers, > Marc. > -- > HtmlUnit support & consulting from the source > Blog: http://mguillem.wordpress.com > > > Le 27/01/2011 00:44, Neera Sharma a écrit : >> Hi All, >> >> I am trying to use DOM parser to parse the following URL >> http://www.helloneighbour.com/save/city-movers-and-transports-trucking-and-freight-mississauga >> >> with the following parser settings - >> parser.setFeature("http://cyberneko.org/html/features/augmentations", >>true); >> parser.setProperty("http://cyberneko.org/html/properties/names/elems", >> "lower"); >> >> I am running into the following namespace error >> >> org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create >> or change an object in a way which is incorrect with regard to >> namespaces. >> >> at org.apache.xerces.dom.CoreDocumentImpl?.checkNamespaceWF(Unknown Source) >> at org.apache.xerces.dom.ElementNSImpl.setName(Unknown Source) >> at org.apache.xerces.dom.ElementNSImpl.<init>(Unknown Source) >> at org.apache.xerces.dom.CoreDocumentImpl?.createElementNS(Unknown Source) >> at org.dom4j.io.DOMWriter.appendDOMTree(DOMWriter.java:181) >> at org.dom4j.io.DOMWriter.appendDOMTree(DOMWriter.java:158) >> ----- >> ----- >> >> I would really appreciate any help that you can provide to resolve the >>issue. >> >> >> Thanks, >> Neera >> > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! >Finally, a world-class log management solution at an even better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires >February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > nekohtml-user mailing list > nek...@li... > https://lists.sourceforge.net/lists/listinfo/nekohtml-user > |
From: Marc G. <mgu...@ya...> - 2011-01-27 10:12:06
|
Hi, please reduce the html content to the minimum allowing to reproduce the problem and open an issue. Cheers, Marc. -- HtmlUnit support & consulting from the source Blog: http://mguillem.wordpress.com Le 27/01/2011 00:44, Neera Sharma a écrit : > Hi All, > > I am trying to use DOM parser to parse the following URL > http://www.helloneighbour.com/save/city-movers-and-transports-trucking-and-freight-mississauga > > with the following parser settings - > parser.setFeature("http://cyberneko.org/html/features/augmentations", true); > parser.setProperty("http://cyberneko.org/html/properties/names/elems", > "lower"); > > I am running into the following namespace error > > org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create > or change an object in a way which is incorrect with regard to > namespaces. > > at org.apache.xerces.dom.CoreDocumentImpl?.checkNamespaceWF(Unknown Source) > at org.apache.xerces.dom.ElementNSImpl.setName(Unknown Source) > at org.apache.xerces.dom.ElementNSImpl.<init>(Unknown Source) > at org.apache.xerces.dom.CoreDocumentImpl?.createElementNS(Unknown Source) > at org.dom4j.io.DOMWriter.appendDOMTree(DOMWriter.java:181) > at org.dom4j.io.DOMWriter.appendDOMTree(DOMWriter.java:158) > ----- > ----- > > I would really appreciate any help that you can provide to resolve the issue. > > > Thanks, > Neera > |
From: Neera S. <nee...@gm...> - 2011-01-26 23:44:15
|
Hi All, I am trying to use DOM parser to parse the following URL http://www.helloneighbour.com/save/city-movers-and-transports-trucking-and-freight-mississauga with the following parser settings - parser.setFeature("http://cyberneko.org/html/features/augmentations", true); parser.setProperty("http://cyberneko.org/html/properties/names/elems", "lower"); I am running into the following namespace error org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. at org.apache.xerces.dom.CoreDocumentImpl?.checkNamespaceWF(Unknown Source) at org.apache.xerces.dom.ElementNSImpl.setName(Unknown Source) at org.apache.xerces.dom.ElementNSImpl.<init>(Unknown Source) at org.apache.xerces.dom.CoreDocumentImpl?.createElementNS(Unknown Source) at org.dom4j.io.DOMWriter.appendDOMTree(DOMWriter.java:181) at org.dom4j.io.DOMWriter.appendDOMTree(DOMWriter.java:158) ----- ----- I would really appreciate any help that you can provide to resolve the issue. Thanks, Neera |
From: test t. <jl...@gm...> - 2011-01-25 13:05:03
|
HI, No, As far as i set the balance html tags true settings. I'm expecting it'll balance the table tag. As td tag is improperly handled Regards, Aswini On Mon, Jan 24, 2011 at 7:51 PM, Marc Guillemot <mgu...@ya...> wrote: > Hi, > > why should NekoHTML insert a table tag here? As far as I can see, > Firefox doesn't insert one. > > Cheers, > Marc. > -- > HtmlUnit support & consulting from the source > Blog: http://mguillem.wordpress.com > > > Le 24/01/2011 12:40, test test a écrit : > > Hi, > > > > When parsing html content using nekohtml parser, it does not balance > > table tag. > > > > For example the given html content as below: > > > > <div> > > <td style="font-family:verdana, font-size:2"> > > <div> > > <a href="http://abc.com <http://abc.com/>"> click here</a> > > <table> <tr> <td> <img src ="http://abc.com/a.jpg > "></td></tr></table> > > </div> > > </div> > > > > > > I'm expecting the result should be like this. > > > > <div> > > <table><tr> > > <td style="font-family:verdana, font-size:2"> > > <div> > > <a href="http://abc.com <http://abc.com/>"> click here</a> > > <table> <tr> <td> <img src ="http://abc.com/a.jpg > "></td></tr></table> > > </div> > > </tr> > > </table> > > </div> > > > > > > > > I want table tag to be inserted properly, if table tag is not present > > but td tag presents. So guide me what are nekohtml parser settings i've > > to made to get the expected results > > > > Thanks in Advance > > > > Regards, > > Aswini > > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better > price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > nekohtml-user mailing list > nek...@li... > https://lists.sourceforge.net/lists/listinfo/nekohtml-user > |
From: Marc G. <mgu...@ya...> - 2011-01-24 14:21:14
|
Hi, why should NekoHTML insert a table tag here? As far as I can see, Firefox doesn't insert one. Cheers, Marc. -- HtmlUnit support & consulting from the source Blog: http://mguillem.wordpress.com Le 24/01/2011 12:40, test test a écrit : > Hi, > > When parsing html content using nekohtml parser, it does not balance > table tag. > > For example the given html content as below: > > <div> > <td style="font-family:verdana, font-size:2"> > <div> > <a href="http://abc.com <http://abc.com/>"> click here</a> > <table> <tr> <td> <img src ="http://abc.com/a.jpg"></td></tr></table> > </div> > </div> > > > I'm expecting the result should be like this. > > <div> > <table><tr> > <td style="font-family:verdana, font-size:2"> > <div> > <a href="http://abc.com <http://abc.com/>"> click here</a> > <table> <tr> <td> <img src ="http://abc.com/a.jpg"></td></tr></table> > </div> > </tr> > </table> > </div> > > > > I want table tag to be inserted properly, if table tag is not present > but td tag presents. So guide me what are nekohtml parser settings i've > to made to get the expected results > > Thanks in Advance > > Regards, > Aswini |
From: test t. <jl...@gm...> - 2011-01-24 11:41:00
|
Hi, When parsing html content using nekohtml parser, it does not balance table tag. For example the given html content as below: <div> > <td style="font-family:verdana, font-size:2"> > <div> > <a href="http://abc.com"> click here</a> > <table> <tr> <td> <img src ="http://abc.com/a.jpg"></td></tr></table> > </div> > </div> > I'm expecting the result should be like this. <div> > <table><tr> > <td style="font-family:verdana, font-size:2"> > <div> > <a href="http://abc.com"> click here</a> > <table> <tr> <td> <img src ="http://abc.com/a.jpg"></td></tr></table> > </div> > </tr> > </table> > </div> > I want table tag to be inserted properly, if table tag is not present but td tag presents. So guide me what are nekohtml parser settings i've to made to get the expected results Thanks in Advance Regards, Aswini |
From: Neera S. <nee...@gm...> - 2011-01-19 21:30:53
|
Hi, Does DOMFragmentParser work with URLs as input source? I tried passing an URL input source to the parse, but its very slow(sometime) hangs with no output. Are there other ways to parse URLs using nekoHTML? I'd really appreciate any tips that you can share. Thanks. |
From: Joel H. <jo...@su...> - 2011-01-15 14:23:31
|
Hi Folks, I'm using neko 1.9.14. Is need to process the comments and nodes in an HTML doc maintaining the order in which they 'appear' in the DOM. Fundamentally I need to be able to output IE fudges in the original HTML, such as: <!--[if lte IE 6]><body class="news ie"><![endif]--> I have set up the same handler I use for processing DOM events, to process comments: parser.setProperty("http://xml.org/sax/properties/lexical-handler", consumer); But I am notified of all the comments first, and then later the DOM nodes (head, body etc...) What I really need to do is process comments and DOM nodes, in order, as they all appear in the doc. Is this even possible? Many thanks Joel PS - question also posted to StackOverflow: http://stackoverflow.com/questions/4699814/processing-xml-comments-using-sax-cyberneko-in-dom-order |
From: Jacob K. <ho...@vi...> - 2010-12-21 02:20:29
|
http://nekohtml.sourceforge.net/usage.html BTW, you should send user questions to the user list [1]. [1] nek...@li... Jake On 12/19/2010 9:08 AM, moatz shawki wrote: > Dear all > > Kindly I need to parse unstructured html file . is there tutirla how > to use nekohtml or simple project that do that > > Regards > Moatz > > > > ------------------------------------------------------------------------------ > Lotusphere 2011 > Register now for Lotusphere 2011 and learn how > to connect the dots, take your collaborative environment > to the next level, and enter the era of Social Business. > http://p.sf.net/sfu/lotusphere-d2d > > > > _______________________________________________ > nekohtml-developer mailing list > nek...@li... > https://lists.sourceforge.net/lists/listinfo/nekohtml-developer |
From: Thierry L. <tl...@gm...> - 2010-12-03 12:15:48
|
Hi, First I would like to congratulate the dev team for this parser quality :) I've been integrating Nekohtml in my Android application<http://sites.google.com/site/freeboxrecorder/>for 10 months and yesterday I got my very first crash report on this code. However the reason is not obvious for me :( Here is backtrace I got (uncomplete unfortunatly): java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:200) at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273) at java.util.concurrent.FutureTask.setException(FutureTask.java:124) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) at java.lang.Thread.run(Thread.java:1096) Caused by: java.lang.ExceptionInInitializerError at org.cyberneko.html.HTMLConfiguration.createDocumentScanner(HTMLConfiguration.java:306) at org.cyberneko.html.HTMLConfiguration.<init>(HTMLConfiguration.java:170) at com.tlegras.freeboxrec.FBRHttpUtils.executeRequest(FBRHttpUtils.java:150) at com.tlegras.freeboxrec.FBRHttpUtils.doGetRequest(FBRHttpUtils.java:208) at com.tlegras.freeboxrec.FBRBroadcastLoadDetailTask.doInBackground(FBRBroadcastLoadDetailTask.java:84) at com.tlegras.freeboxrec.FBRBroadcastLoadDetailTask.doInBackground(FBRBroadcastLoadDetailTask.java:1) at android.os.AsyncTask$2.call(AsyncTask.java:185) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) ... 4 more Caused by: java.lang.StackOverflowError ... 12 more Unfortunatly, the Android integrated crash report does not include the full backtrace, I miss the bottom :( and the sender is anonym, no way to contact him. Of course, it is impossible to reproduce this issue on my terminal; it seems the crash occured in a nominal path, not a rare case. Looking at the code, I don't think it is due to a recursion issue. Did someone experienced something similar? Cheers, Thierry. |
From: Alain G. <AGi...@ta...> - 2010-11-10 19:30:50
|
Hi, I have a test case showing that the ElementRemover seems to get out of sync after having removed an element. Can someone check that I am using this class correctly? Regards, Alain Gilbert Follows my JUnit test class: package org.cyberneko.html; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import junit.framework.TestCase; import org.apache.xerces.xni.parser.XMLInputSource; import org.apache.xerces.xni.parser.XMLParserConfiguration; import org.cyberneko.html.filters.ElementRemover; import org.cyberneko.html.filters.Writer; public class ElementRemoverTest extends TestCase { private static final String DOCUMENT_FRAGMENT = "http://cyberneko.org/html/features/balance-tags/document-fragment"; private static final String IGNORE_OUTSIDE_CONTENT = "http://cyberneko.org/html/features/balance-tags/ignore-outside-content"; protected static final String NAMES_ELEMS = "http://cyberneko.org/html/properties/names/elems"; private static final String FILTERS = "http://cyberneko.org/html/properties/filters"; public void testRemoveClosedElement() throws IOException { String src = "<input type=\"text\">foo</input><span>bof</span>"; String expected = "<span>bof</span>"; assertEquals(expected, parseFragment(src)); } public void testRemoveEmptyElement() throws IOException { String src = "<input type=\"text\"/><span>bof</span>"; String expected = "<span>bof</span>"; assertEquals(expected, parseFragment(src)); } public void testRemoveUnclosedElement() throws IOException { String src = "<input type=\"text\"><span>bof</span>"; String expected = "<span>bof</span>"; assertEquals(expected, parseFragment(src)); } private String parseFragment(String pHTMLFragment) throws IOException { XMLParserConfiguration parser = new HTMLConfiguration(); // Enable HTML fragments. parser.setFeature(DOCUMENT_FRAGMENT, true); parser.setFeature(IGNORE_OUTSIDE_CONTENT, true); // Element names to lowercase. parser.setProperty(NAMES_ELEMS, "lower"); StringWriter out = new StringWriter(); ElementRemover remover = new ElementRemover(); remover.removeElement("input"); remover.acceptElement("span", null); org.apache.xerces.xni.parser.XMLDocumentFilter[] filters = {remover, new Writer(out, "UTF-8") }; parser.setProperty(FILTERS, filters); XMLInputSource source = new XMLInputSource(null, "ElementRemoval", null, new StringReader(pHTMLFragment), "UTF-8"); parser.parse(source); return out.toString(); } } |
From: Frederic L. <fre...@gm...> - 2010-10-14 18:35:37
|
Hi, noticed a post in this thread from someone having the same problem as i was with the filter / writer output to stdout... https://sourceforge.net/mailarchive/message.php?msg_name=3836ec640912141636q175851fav98479f932a6d2601%40mail.gmail.com So, this seems to work: import org.apache.commons.io.output.NullOutputStream def org.cyberneko.html.filters.Writer writer = new org.cyberneko.html.filters.Writer( new NullOutputStream(), 'UTF-8') BTW, tks for writing this parser, it works well! Fred~ |
From: Jacob K. <ho...@vi...> - 2010-09-02 21:50:49
|
Or, rather than at parse time, you can manipulate the DOM using a NodeFilter after the DOM has been created.... public class MyHrefFilter implements NodeFilter { public final short acceptNode(final Node n) { final String classVal = el.getAttribute("class"); if (classVal != null and classVal.indexOf("js-removal") > -1) { el.removeAttribute("href"); return NodeFilter.FILTER_ACCEPT; } else { return NodeFilter.FILTER_SKIP; } } } Then in your application code.... Document myDocument = .....; boolean expandEntityReferences = false; NodeIterator iter = ((DocumentTraversal) myDocument).createNodeIterator( myDocument, NodeFilter.SHOW_ELEMENT, new MyHrefFilter(), expandEntityReferences); //Must iterate in order to apply NodeFilter changes while (iter.nextNode() != null); iter.detach(); Jake On Wed, 1 Sep 2010 14:59:15 -0700 Andy Clark <an...@cy...> wrote: >For more advanced element processing, you'll probably want to implement your >own filter class. It's probably a good idea to use the element remover filter >as a starting point because when you want to remove an element you need to >remove all of its children (and their children) in addition to the starting >and ending element tags. > > There is more information about custom filters and how to use them in the >documentation. > > Sent from my iPad > > On Sep 1, 2010, at 3:58 AM, Clelio de Souza <cle...@gm...> wrote: > >> Hi all, >> >> I need to remove certain hyperlinks tags, which contain a certain "class" >>attribute, for instance: "<a href='http://link.com' class='js-removal'>link >>body</a>". The reason for it is that I want to keep all other hyperlinks >>("href") tags and only remove those marked by a certain attribute (I was >>wondering to use the "class" attribute for that). >> >> Is there anyway to do that? >> >> Note: The current "removeElement(String element)" method only remove the >>entire element. It does not consider any attributes information. >> >> Thanks & Regards, >> >> Clelio de Souza >> >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net Dev2Dev email is sponsored by: >> >> Show off your parallel programming skills. >> Enter the Intel(R) Threading Challenge 2010. >> http://p.sf.net/sfu/intel-thread-sfd >> _______________________________________________ >> nekohtml-user mailing list >> nek...@li... >> https://lists.sourceforge.net/lists/listinfo/nekohtml-user |
From: Andy C. <an...@cy...> - 2010-09-01 22:11:00
|
For more advanced element processing, you'll probably want to implement your own filter class. It's probably a good idea to use the element remover filter as a starting point because when you want to remove an element you need to remove all of its children (and their children) in addition to the starting and ending element tags. There is more information about custom filters and how to use them in the documentation. Sent from my iPad On Sep 1, 2010, at 3:58 AM, Clelio de Souza <cle...@gm...> wrote: > Hi all, > > I need to remove certain hyperlinks tags, which contain a certain "class" attribute, for instance: "<a href='http://link.com' class='js-removal'>link body</a>". The reason for it is that I want to keep all other hyperlinks ("href") tags and only remove those marked by a certain attribute (I was wondering to use the "class" attribute for that). > > Is there anyway to do that? > > Note: The current "removeElement(String element)" method only remove the entire element. It does not consider any attributes information. > > Thanks & Regards, > > Clelio de Souza > > > > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > nekohtml-user mailing list > nek...@li... > https://lists.sourceforge.net/lists/listinfo/nekohtml-user |
From: Clelio de S. <cle...@gm...> - 2010-09-01 10:58:17
|
Hi all, I need to remove certain hyperlinks tags, which contain a certain "class" attribute, for instance: "<a href='http://link.com' class='js-removal'>link body</a>". The reason for it is that I want to keep all other hyperlinks ("href") tags and only remove those marked by a certain attribute (I was wondering to use the "class" attribute for that). Is there anyway to do that? Note: The current "removeElement(String element)" method only remove the entire element. It does not consider any attributes information. Thanks & Regards, Clelio de Souza |
From: JEFFREY H. <has...@sb...> - 2010-08-19 22:06:38
|
This issue actually may be related to BUG 3031869 as there is whitespace in the TAG. They have a space between the End of the tag and the > bracket. Jeffrey Haskovec ________________________________ From: JEFFREY HASKOVEC <has...@sb...> To: nek...@li... Sent: Thu, August 19, 2010 3:05:12 PM Subject: How does NekoHTML deal with custom tags in an HTML file I was trying to parse a NYTimes.com story and I am not seeing any of the nodes with the article in them. I noticed that they use some custom tags around the article such as: <NYT_TEXT > What would be the behavior of NekoHTML upon parsing a tag such as that? It seems like it is dropping everything within it, or else I am not seeing the expected nodes that live inside of that tag. Thanks, Jeffrey Haskovec |
From: JEFFREY H. <has...@sb...> - 2010-08-19 20:05:23
|
I was trying to parse a NYTimes.com story and I am not seeing any of the nodes with the article in them. I noticed that they use some custom tags around the article such as: <NYT_TEXT > What would be the behavior of NekoHTML upon parsing a tag such as that? It seems like it is dropping everything within it, or else I am not seeing the expected nodes that live inside of that tag. Thanks, Jeffrey Haskovec |
From: Donnie P. <do...@cs...> - 2010-08-15 06:04:13
|
I am trying to parse some particularly annoying HTML, and unfortunately Neko is not handling it very well. In the HTML document, I have links that look like this: "<a class=foo 1' href='/link/text'>1</a>" Unfortunately, the "href" attribute gets dropped completely, and the anchor ends up with a "class" attribute, and another attribute named "1" whose value is an empty string. Any suggestions? This is pretty important for me to be able to parse, so I'm even willing to patch the parser if necessary. Thanks!!! :-) -Donnie Pinkston |
From: Misha K. <mis...@gm...> - 2010-06-11 17:36:43
|
Thank you. Will try. It looks like it does not work with XmlSlurper though :( http://www.maclovin.de/2010/02/robust-html-parsing-the-groovy-way/ Thank you! Misha On Fri, 2010-06-11 at 11:45 -0500, Jacob Kjome wrote: > Did you try using a org.cyberneko.html.parsers.DOMFragmentParser yet? > > http://nekohtml.sourceforge.net/usage.html > > Jake > > > On Fri, 11 Jun 2010 11:32:40 -0500 > Misha Koshelev <mis...@gm...> wrote: > > Thank you so much for a great product! > > > > I am trying to parse the following HTML fragment, and I would like to > > get the same fragment as output (without HTML and BODY tags). Is this > > possible? If so, how? > > > > Thank you > > Misha > > > > p.s. I am reading here: > > http://nekohtml.sourceforge.net/faq.html#fragments > > and I believe I have added the correct options below. However, the > > output is still incorrect :( > > > > Thank you > > Misha > > > > #!/usr/bin/env groovy > > > > def text=""" > > <div><h2>Test</h2> > > <div>Hi</div> > > </div> > > """ > > > > // Parse > > def config=new org.cyberneko.html.HTMLConfiguration() > > > > config.setFeature("http://cyberneko.org/html/features/balance-tags/document-fragment",true) > > def html=new XmlSlurper(new > > org.cyberneko.html.parsers.SAXParser()).parseText(text) > > > > // Output > > import groovy.xml.MarkupBuilder > > import groovy.xml.StreamingMarkupBuilder > > import groovy.util.XmlNodePrinter > > import groovy.util.slurpersupport.NodeChild > > > > def printNode(NodeChild node) { > > def writer = new StringWriter() > > writer << new StreamingMarkupBuilder().bind { > > mkp.declareNamespace('':node[0].namespaceURI()) > > mkp.yield node > > } > > new XmlNodePrinter().print(new > > XmlParser().parseText(writer.toString())) > > } > > printNode(html) > > > > Output: > > > > <HTML> > > <tag0:HEAD xmlns:tag0="http://www.w3.org/1999/xhtml"/> > > <BODY> > > <DIV> > > <H2> > > Test > > </H2> > > <DIV> > > Hi > > </DIV> > > </DIV> > > </BODY> > > </HTML> > > > > > > > > ------------------------------------------------------------------------------ > > ThinkGeek and WIRED's GeekDad team up for the Ultimate > > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > > lucky parental unit. See the prize list and enter to win: > > http://p.sf.net/sfu/thinkgeek-promo > > _______________________________________________ > > nekohtml-user mailing list > > nek...@li... > > https://lists.sourceforge.net/lists/listinfo/nekohtml-user > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > nekohtml-user mailing list > nek...@li... > https://lists.sourceforge.net/lists/listinfo/nekohtml-user |
From: Jacob K. <ho...@vi...> - 2010-06-11 16:45:18
|
Did you try using a org.cyberneko.html.parsers.DOMFragmentParser yet? http://nekohtml.sourceforge.net/usage.html Jake On Fri, 11 Jun 2010 11:32:40 -0500 Misha Koshelev <mis...@gm...> wrote: > Thank you so much for a great product! > > I am trying to parse the following HTML fragment, and I would like to > get the same fragment as output (without HTML and BODY tags). Is this > possible? If so, how? > > Thank you > Misha > > p.s. I am reading here: > http://nekohtml.sourceforge.net/faq.html#fragments > and I believe I have added the correct options below. However, the > output is still incorrect :( > > Thank you > Misha > > #!/usr/bin/env groovy > > def text=""" > <div><h2>Test</h2> > <div>Hi</div> > </div> > """ > > // Parse > def config=new org.cyberneko.html.HTMLConfiguration() > > config.setFeature("http://cyberneko.org/html/features/balance-tags/document-fragment",true) > def html=new XmlSlurper(new > org.cyberneko.html.parsers.SAXParser()).parseText(text) > > // Output > import groovy.xml.MarkupBuilder > import groovy.xml.StreamingMarkupBuilder > import groovy.util.XmlNodePrinter > import groovy.util.slurpersupport.NodeChild > > def printNode(NodeChild node) { > def writer = new StringWriter() > writer << new StreamingMarkupBuilder().bind { > mkp.declareNamespace('':node[0].namespaceURI()) > mkp.yield node > } > new XmlNodePrinter().print(new > XmlParser().parseText(writer.toString())) > } > printNode(html) > > Output: > > <HTML> > <tag0:HEAD xmlns:tag0="http://www.w3.org/1999/xhtml"/> > <BODY> > <DIV> > <H2> > Test > </H2> > <DIV> > Hi > </DIV> > </DIV> > </BODY> > </HTML> > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > nekohtml-user mailing list > nek...@li... > https://lists.sourceforge.net/lists/listinfo/nekohtml-user > |
From: Misha K. <mis...@gm...> - 2010-06-11 16:32:52
|
Thank you so much for a great product! I am trying to parse the following HTML fragment, and I would like to get the same fragment as output (without HTML and BODY tags). Is this possible? If so, how? Thank you Misha p.s. I am reading here: http://nekohtml.sourceforge.net/faq.html#fragments and I believe I have added the correct options below. However, the output is still incorrect :( Thank you Misha #!/usr/bin/env groovy def text=""" <div><h2>Test</h2> <div>Hi</div> </div> """ // Parse def config=new org.cyberneko.html.HTMLConfiguration() config.setFeature("http://cyberneko.org/html/features/balance-tags/document-fragment",true) def html=new XmlSlurper(new org.cyberneko.html.parsers.SAXParser()).parseText(text) // Output import groovy.xml.MarkupBuilder import groovy.xml.StreamingMarkupBuilder import groovy.util.XmlNodePrinter import groovy.util.slurpersupport.NodeChild def printNode(NodeChild node) { def writer = new StringWriter() writer << new StreamingMarkupBuilder().bind { mkp.declareNamespace('':node[0].namespaceURI()) mkp.yield node } new XmlNodePrinter().print(new XmlParser().parseText(writer.toString())) } printNode(html) Output: <HTML> <tag0:HEAD xmlns:tag0="http://www.w3.org/1999/xhtml"/> <BODY> <DIV> <H2> Test </H2> <DIV> Hi </DIV> </DIV> </BODY> </HTML> |
From: Misha K. <mis...@gm...> - 2010-05-26 12:30:22
|
Yes thank you. I fixed it. Even included a conformance test ;) Misha Jacob Kjome wrote: > Did you try?... > > //*[@id='elementId_0']//*[@id='main'] > > > Jake > > On 5/25/2010 3:06 PM, Misha Koshelev wrote: >> Dear All: >> >> Thank you for all your help. I am again adding your product to my automation framework >> www.mkosh.com >> >> Specifically, as element IDs do not seem to be easily retrievable with getElementById(), I have decided to >> utilize a combined XPath approach. >> >> I am using what I am learning about XPath from: >> http://www.w3schools.com/xpath/xpath_syntax.asp >> >> It seems like a statement as: >> *[@id='elementId_0']//*[@id='main'] >> >> Should be kosher to find all elements that are descendants of element A with id main, where element A is the >> element in the main document that has elementId_0 >> >> However, for some reason I am not getting the desired results >> >> Any ideas? >> >> Thank you >> Misha >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> nekohtml-user mailing list >> nek...@li... >> https://lists.sourceforge.net/lists/listinfo/nekohtml-user >> >> >> > > ------------------------------------------------------------------------------ > > _______________________________________________ > nekohtml-user mailing list > nek...@li... > https://lists.sourceforge.net/lists/listinfo/nekohtml-user |
From: Jacob K. <ho...@vi...> - 2010-05-26 05:01:47
|
Did you try?... //*[@id='elementId_0']//*[@id='main'] Jake On 5/25/2010 3:06 PM, Misha Koshelev wrote: > Dear All: > > Thank you for all your help. I am again adding your product to my automation framework > www.mkosh.com > > Specifically, as element IDs do not seem to be easily retrievable with getElementById(), I have decided to > utilize a combined XPath approach. > > I am using what I am learning about XPath from: > http://www.w3schools.com/xpath/xpath_syntax.asp > > It seems like a statement as: > *[@id='elementId_0']//*[@id='main'] > > Should be kosher to find all elements that are descendants of element A with id main, where element A is the > element in the main document that has elementId_0 > > However, for some reason I am not getting the desired results > > Any ideas? > > Thank you > Misha > > ------------------------------------------------------------------------------ > > _______________________________________________ > nekohtml-user mailing list > nek...@li... > https://lists.sourceforge.net/lists/listinfo/nekohtml-user > > > |
From: Misha K. <mis...@gm...> - 2010-05-25 21:07:02
|
Dear All: Thank you for all your help. I am again adding your product to my automation framework www.mkosh.com Specifically, as element IDs do not seem to be easily retrievable with getElementById(), I have decided to utilize a combined XPath approach. I am using what I am learning about XPath from: http://www.w3schools.com/xpath/xpath_syntax.asp It seems like a statement as: *[@id='elementId_0']//*[@id='main'] Should be kosher to find all elements that are descendants of element A with id main, where element A is the element in the main document that has elementId_0 However, for some reason I am not getting the desired results Any ideas? Thank you Misha |