Okay, so here's the thing: All of you are probably thinking the same thing: you can use
driver.getPageSource();
And this is partially true. The only issue is that the source code gets compiled in a rather strange way where all through the code
\"
starts showing up. I tried removing this manually but that still doesnt fix the problem completely.
One example of what I mean:
normal source code:
\"query_title\":null}",encoded_title:"WyJoZW5rIl0",ref:"unknown",logger_source:"www_main",typeahead_sid:"",tl_log:false,impression_id:"bbdb1882",filter_ids:
Selenium output:
\\\"query_title\\\":null}\",\"encoded_title\":\"WyJoZW5rIl0\",\"ref\":\"br_tf\",\"logger_source\":\"www_main\",\"typeahead_sid\":\"0.6583900225217523\",\"tl_log\":false,\"impression_id\":\"e00060b4\",\"filter_ids\"
It seems to be the same type of thing as where you have to put something in front of certain symbols in quotes, to stop java from seeing it as one of those symbols, but I don't fully understand this behaviour, and have no idea how to fix it... hope you can help :)
edit: replacing doesn't work because of the way this got compiled. An example of why it won't work is actually in the example I included earlier:
original:
}",encoded_title:
compiled version:
}\",\"encoded_title\":
Replacing \" with " would change it in to:
}","encoded_title":
which differs from the original...
And if I were to replace \" with nothing, I would get:
},encoded_title:
which, sadly, still differs from the original. The way this is compiled I just don't think replacing is a viable option...