I have a question that I believe can be resolved using Selenium. I have a collection of URLs, such as the example below.
http://www.sears.com/search=little tikes&Little Tikes?filter=Brand&keywordSearch=false&vName=Toys+%26+Games&catalogId=12605&catPrediction=false&previousSort=ORIGINAL_SORT_ORDER&viewItems=50&storeId=10153&adCell=W3
If you enter the URL into a browser, it will redirect to another URL, which you can confirm in the address bar of the browser (for example, Firefox). I need to retrieve the redirected URL, regardless of whether the redirection was caused by JavaScript code or not. Is it achievable with the Selenium framework?
I've attempted to use HTMLUnit for this task, but I encountered the following error related to JavaScript execution. Any assistance would be appreciated!
com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "indexOf" of null (script in http://www.sears.com/search=little%20tikes&Little%20Tikes?filter=Brand&keywordSearch=false&catalogId=12605&adCell=W3&catPrediction=false&previousSort=ORIGINAL_SORT_ORDER&viewItems=50&storeId=10153&levels=Toys+%26+Games from (6942, 33) to (6974, 14)#6966)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:669) ~[htmlunit-2.12.jar:2.12]
...
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:374) ~[htmlunit-2.12.jar:2.12]