Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
Java Selenium / HtmlunitDriver abre un sitio web incorrecto

Intento abrir un sitio web usando `driver.get(url):

 driver = new HtmlUnitDriver(BrowserVersion.CHROME); driver.setJavascriptEnabled(true); driver.setAcceptSslCertificates(true); driver.setDownloadImages(true); driver.get(<private url>);

Sin embargo, la URL contiene un 'Ö', una diéresis alemana. Entonces el controlador reemplaza 'ö' con '% D6'

Así que abre un sitio equivocado.

Intenté cambiar a UTF-8 en Eclipse; no funcionó

Además, usar Unicode no funcionó.

¿Alguien tiene alguna idea?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Su caso funciona con 2.27-SNAPSHOT .

indexÖ.html:

 <body>Ö</body>

Código Java:

 WebDriver driver = new HtmlUnitDriver(); driver.get("http://localhost:8080/indexÖ.html"); System.out.println(driver.getPageSource());

Producción:

 <?xml version="1.0" encoding="ISO-8859-1"?> <html> <head/> <body> Ã </body> </html>

que es lo que también muestra Chrome real.

Como dijiste, asegúrate de que todo tu espacio de trabajo esté en UTF-8: ingrese la descripción de la imagen aquí

Y si estás usando maven:

 <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!