在netbeans

时间:2017-07-12 00:44:41

标签: java netbeans import

我有一个Java文件给我,我正在尝试编辑,但是当我点击netbeans中的构建时,我得到下面的错误。它做得很好,直到我做出改变。我不确定为什么jar文件以前会工作,但现在我无法构建它。我是个菜鸟......我怎么得到这些包裹?感谢。

C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:15: error: package org.jsoup does not exist
import org.jsoup.Jsoup;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:16: error: package org.jsoup.nodes does not exist
import org.jsoup.nodes.Document;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:17: error: package org.jsoup.nodes does not exist
import org.jsoup.nodes.Element;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:18: error: package org.jsoup.select does not exist
import org.jsoup.select.Elements;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:19: error: package org.openqa.selenium does not exist
import org.openqa.selenium.By;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:20: error: package org.openqa.selenium does not exist
import org.openqa.selenium.Keys;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:21: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebDriver;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:22: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebElement;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:23: error: package org.openqa.selenium.chrome does not exist
import org.openqa.selenium.chrome.ChromeDriver;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:24: error: package org.openqa.selenium.interactions does not exist
import org.openqa.selenium.interactions.Actions;

2 个答案:

答案 0 :(得分:0)

您应该在项目中包含第三方依赖项jar。

https://jsoup.org/download http://docs.seleniumhq.org/download/

您可以从这里下载。 编辑项目属性,转到库并添加这些jar。应该这样做。

答案 1 :(得分:0)

jsoup.jarselenium.jar的路径看起来不正确。 首先从here下载jsoup.jar,从here下载selenium.jar,然后将它们添加到项目的库中。

项目窗口中的netbeans中的

展开项目并右键单击库并选择添加jar /文件夹并找到您的jsoup.jarselenium.jar文件位置并添加它们。然后构建项目。