2

i have been getting a lot of help from you guys and i am really glad. have passed these huddles,

web page source downloaded through Jsoup is not equal to the actual web page source

How to download a Web page source using Selenium

and now i am finally here for the last huddle (hopefully)

while running the selenium test case, like this,

 WebDriver driver = new FirefoxDriver(); FluentWebDriver fwd = new FluentWebDriver(driver); driver.manage().timeouts().implicitlyWait(5L, TimeUnit.SECONDS); driver.get("http://www.justdial.com/Bangalore/Tape-Dealers-%3Cnear%3E-Bangalore-City-Railway-Station/ct-12976/page-5"); String res = driver.getPageSource(); 

it opens up the web browser and starts downloading all the images that are there in the page and caues a delay for the source code to be downloaded from my java program. how can i avoid opening up my browser in this scenario?? i just want the page source and NO graphical content. and hence avoid the delay too... please help!! thanks in advance!!

1
  • You want a Headless driver. You can either use HTMLUnit driver, or PhantomDriver. Commented Nov 16, 2013 at 13:09

1 Answer 1

1

I haven´t used FluentWebDriver but I guess you could try replacing the FirefoxDriver with the HtmlUnitDriver:

Replace:

WebDriver driver = new FirefoxDriver();

With:

HtmlUnitDriver driver = new HtmlUnitDriver();

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.