Это исключение:
Код: Выделить всё
Conectando pagina Seniat
0 [AWT-EventQueue-0] DEBUG org.htmlunit.WebClient - Get page for window named '', using WebRequest[]
0 [AWT-EventQueue-0] DEBUG org.htmlunit.WebClient - Load response for GET http://contribuyente.seniat.gob.ve/BuscaRif/BuscaRif.jsp
16 [AWT-EventQueue-0] DEBUG org.htmlunit.WebWindowImpl - destroyChildren
**Exception in thread "AWT-EventQueue-0" java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.**(SSLConnectionSocketFactory.java:151)
at org.htmlunit.HttpWebConnection.configureHttpsScheme(HttpWebConnection.java:671)
at org.htmlunit.HttpWebConnection.createHttpClientBuilder(HttpWebConnection.java:589)
at org.htmlunit.HttpWebConnection.getHttpClientBuilder(HttpWebConnection.java:545)
at org.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:172)
at org.htmlunit.WebClient.getWebResponseOrUseCached(WebClient.java:1654)
at org.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1559)
at org.htmlunit.WebClient.loadWebResponse(WebClient.java:1484)
at org.htmlunit.WebClient.getPage(WebClient.java:451)
at org.htmlunit.WebClient.getPage(WebClient.java:366)
at org.htmlunit.WebClient.getPage(WebClient.java:504)
at org.htmlunit.WebClient.getPage(WebClient.java:486)
at com.openbravo.pos.smart.ConsultarSENIAT.consultarSENIAT(ConsultarSENIAT.java:73)
at com.openbravo.pos.customers.CustomersView.jTextArea1MouseClicked(CustomersView.java:2186)
at com.openbravo.pos.customers.CustomersView.access$900(CustomersView.java:69)
at com.openbravo.pos.customers.CustomersView$8.mouseClicked(CustomersView.java:1305)
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
...
Код: Выделить всё
package com.openbravo.pos.smart;
import java.awt.image.BufferedImage;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import org.htmlunit.WebClient;
import org.htmlunit.html.HtmlPage;
/**
*
* @author Smart Office Factory
*/
public class ConsultarSENIAT {
public Element CI;
public Element RIF;
public BufferedImage Captcha;
public Element Boton;
public Element Codigo;
public Document doc;
public ConsultarSENIAT(){
this.CI=CI;
this.RIF=RIF;
this.Captcha=Captcha;
this.Boton=Boton;
this.Codigo=Codigo;
}
public String consultarSENIAT() {
System.out.println("Conectando pagina Seniat");
String Resultado="";
try (final WebClient webClient = new WebClient()) {
webClient.getOptions().setJavaScriptEnabled(true); // Habilitar JavaScript si es necesario
webClient.getOptions().setCssEnabled(true); // Habilitar CSS si es necesario
HtmlPage page = webClient.getPage("http://contribuyente.seniat.gob.ve/BuscaRif/BuscaRif.jsp");
webClient.waitForBackgroundJavaScript(10000); // Esperar a que se cargue el JavaScript en segundo plano
webClient.waitForBackgroundJavaScriptStartingBefore(10000); // Esperar a que comience la carga del JavaScript en segundo plano*/
// Aquí puedes realizar acciones adicionales una vez que la página ha cargado completamente
System.out.println("Título de la página: " + page.getTitleText());
// Agrega tu código adicional aquí
} catch (Exception e) {
e.printStackTrace();
}
Код: Выделить всё
4.0.0
UnicentaSmarT
UnicentaSmarT
1.0-SNAPSHOT
jar
UTF-8
11
11
net.sourceforge.htmlunit
htmlunit
4.0.0
org.apache.logging.log4j
log4j-1.2-api
2.17.2
Подробнее здесь: https://stackoverflow.com/questions/783 ... -thread-aw