Link to home
Start Free TrialLog in
Avatar of yescobar2012
yescobar2012

asked on

why do I received WARN messages when I ran code in htmlunit

Hello I am new to HtmlUnit, I've install the latest htmlunit-2.12.jar and I want to run a couple of examples to start understanding it. When I run this code I get many WARN messages. Why do i get WARN messages? Is there a way to turn them off? Do i need to know about the WARN messages?

package com.att.temp;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.List;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.util.NameValuePair;

public class HtmlDelete {

	public static void main(String[] args) throws FailingHttpStatusCodeException, MalformedURLException, IOException {

		WebClient webClient = new WebClient();
		HtmlPage currentPage = 
			webClient.getPage("http://www.google.com/search?q=htmlunit");

		List<NameValuePair> headers = 
			currentPage.getWebResponse().getResponseHeaders();
		for (NameValuePair header : headers) {
			System.out.println(header.getName() + " = " + header.getValue());
		}
	}
	
	
 }

Open in new window


Output

WARN  (IncorrectnessListenerImpl.java:38 ) - Obsolete content type encountered: 'text/javascript'.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:1419] Error in style rule. (Invalid token ":". Was expecting one of: <EOF>, <S>, <NUMBER>, "inherit", <IDENT>, <STRING>, <PLUS>, <COMMA>, <HASH>, <IMPORTANT_SYM>, <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <PERCENTAGE>, <DIMENSION>, <URI>, <FUNCTION>, "}", ";", "/", "-".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:1419] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:2203] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:2203] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:2543] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:2543] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:2616] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:2616] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:3194] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:3194] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:3701] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:3701] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:3761] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:3761] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:4196] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:4196] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:4960] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:4960] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:5610] Error in pseudo class or element. (Invalid token ":". Was expecting one of: <IDENT>, <FUNCTION_NOT>, <FUNCTION_LANG>, <FUNCTION>.)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:5610] Ignoring the whole rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:6103] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:6103] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:6338] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:6338] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:6781] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:6781] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:6938] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:6938] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:7010] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:7010] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:7352] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:7352] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:7872] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:7872] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:8755] Error in pseudo class or element. (Invalid token ":". Was expecting one of: <IDENT>, <FUNCTION_NOT>, <FUNCTION_LANG>, <FUNCTION>.)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:8755] Ignoring the whole rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:9034] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:9061] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:9061] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:9690] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:9717] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:9717] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:10292] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:10319] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:10319] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:10824] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:10851] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:10851] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:11330] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:11354] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:11354] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:11841] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:11865] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:11865] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:12748] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:12748] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:12874] Error in expression. (Invalid token "color-stop(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:12963] Error in style rule. (Invalid token "left". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:12963] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:13203] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:13243] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:13243] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:13776] Error in expression. (Invalid token "color-stop(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:13865] Error in style rule. (Invalid token "background". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:13865] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:828] Error in expression. (Invalid token "#4d90fe". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:845] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:845] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:1340] Error in expression. (Invalid token "#4d90fe". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:1357] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:1357] Ignoring the following declarations in this rule.
Date = Tue, 18 Jun 2013 20:17:20 GMT
Expires = -1
Cache-Control = private, max-age=0
Content-Type = text/html; charset=UTF-8
Set-Cookie = PREF=ID=abb429facc153e67:FF=0:TM=1371586640:LM=1371586640:S=GH2sLni_ebVb4d4W; expires=Thu, 18-Jun-2015 20:17:20 GMT; path=/; domain=.google.com
Set-Cookie = NID=67=k3S90Te-jMt0uAkulEJs5Q1vnbIBTzwFReae45iBKJoGBV5-YtbIz5Jon4Nj8OYrtBJYu6ZlAf-imS3UOCSW-7VlqoeagCB4XiH9qi5bDvEPMXzbxIs9Q8MIyrQFa_RN; expires=Wed, 18-Dec-2013 20:17:20 GMT; path=/; domain=.google.com; HttpOnly
P3P = CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Content-Encoding = gzip
Server = gws
X-XSS-Protection = 1; mode=block
X-Frame-Options = SAMEORIGIN
Transfer-Encoding = chunked

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yescobar2012
yescobar2012

ASKER

did not answer my question