System.setProperty("webdriver.gecko.driver", "c:/selenium/geckodriver.exe");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(capabilities);
driver.get("articleUrl");
String pageSource = driver.getPageSource();
// at this point if I do pageSource.indexOf("'") it returns -1 ... it can't find the apostrophe
Document doc = Jsoup.parse(pageSource);
Dwight,
You might want to go one step further with this and perhaps have this reside as part of the org.openqa.selenium.remote.HttpCommandExecutor#execute implementation wherein you specifically look for the command org.openqa.selenium.remote.DriverCommand#GET_PAGE_SOURCE and if that’s the command, you directly apply your logic within your custom execute() method.
That way your code would not be making any extra calls.
For details on how to inject in a custom CommandExecutor implementation into your webdriver instance you can take a look at my blog here.
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/62dfd8cf-a843-4e68-ae3b-064391ccfcf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.