Login Register






scraping filter_list
Author
Message
RE: scraping #3
that seems to be what im looking for thanks but i am having a few probs i installed the complete lobo package and download the cobra library and impoted it to ide i got some code that should work from another forum

Code:
package cobtest; import com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl; import java.net.URL; import org.omg.CORBA_2_3.portable.InputStream; import org.w3c.dom.Document; import org.w3c.dom.Element; public class Cobtest { public static void main(String[] args) { UserAgentContext uacontext = new SimpleUserAgentContext(); DocumentBuilderImpl builder = new DocumentBuilderImpl(rcontext); URL url = new URL(TEST_URI); InputStream in = url.openConnection().getInputStream(); try { Document d = builder.parse(new InputSourceImpl(in, TEST_URI, "utf-8")); } finally { System.out.println("blah"); } in.close(); Element ele = d.getElementById("name"); System.out.println(ele.getAttribute("value")); } }
the problem is UserAgentConteext still has redlines under and i dont have write package to fix this any ideas on what its looking for as cobras support aint great
thanks

the problem is

Reply





Messages In This Thread
scraping - by chuck19 - 04-10-2013, 09:07 PM