Jump to content

Loading Jaunt Issue


AntiVenom

Recommended Posts

I'm attempting to use Jaunt to scrape data from the web, when ran inside of an IDE this works fine, however when ran through OSBot it seemingly has issues. Does anyone have any information to fix this error?

Bot Debug Log

[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example1.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example2.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example3$1.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example3.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example4.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example5.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example6.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example7.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example8.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example9.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example1.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example10.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example2.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example3.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example4.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example5.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example6.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example7.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example8.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example9.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example1.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example2.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example3$1.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example3.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example4.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example5.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example6.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example7.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example8.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example9.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example1.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example10.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example2.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example3.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example4.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example5.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example6.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example7.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example8.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example9.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example1.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example2.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example3$1.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example3.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example4.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example5.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example6.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example7.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example8.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_extra\Example9.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example1.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example10.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example2.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example3.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example4.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example5.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example6.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example7.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example8.class
[ERROR][08/13 02:27:39 AM]: Failed to load local script : examples_json\Example9.class
[ERROR][08/13 02:27:40 AM]: Uncaught exception!
java.lang.NoClassDefFoundError: com/jaunt/JauntException
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
	at java.lang.Class.getConstructor0(Unknown Source)
	at java.lang.Class.getConstructor(Unknown Source)
	at org.osbot.UB.run(dw:269)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.jaunt.JauntException
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 8 more

 

My Class (below)

package com.shrykur.scripts.herblore;

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import com.jaunt.Element;
import com.jaunt.Elements;
import com.jaunt.JauntException;
import com.jaunt.UserAgent;

@ScriptManifest(author = "Default", info = "Ranarr Potion Maker", logo = "", name = "Herblore", version = 0)
public class Node extends Script {

	@Override
	public void onStart() throws InterruptedException {
		try {
			log("Starting Webscraper");
			UserAgent userAgent = new UserAgent(); // create new userAgent (headless browser)
			userAgent.settings.autoSaveAsHTML = true;
			userAgent.visit("http://google.com"); // visit google
			userAgent.doc.apply("butterflies"); // apply form input (starting at first editable field)
			userAgent.doc.submit("Google Search"); // click submit button labelled "Google Search"

			Elements links = userAgent.doc.findEvery("<h3 class=r>").findEvery("<a>"); // find search result links
			for (Element link : links)
				System.out.println(link.getAt("href")); // print results
		} catch (JauntException e) {
			e.printStackTrace();
		}
	}

	@Override
	public int onLoop() throws InterruptedException {

		return 3000;
	}

	@Override
	public void onExit() throws InterruptedException {

	}
}

 

Edited by AntiVenom
Link to comment
Share on other sites

21 hours ago, Chris said:

include the jaunt library in your jar

and make sure the jaunt library is in the src.

@Chris
So as long as the libraries .jar file is located in src it should be able to use the file is that correct? Would this apply to json files as well? assuming I wanted to use a json file could I just call it from the src folder?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...