Selenium find element with document.write
As it turns out after some digging into the code, Selenium does the search in the rendered final view, but the problem was not the document.write(), but the fact that the field I was looking for was in an iframe, which selenium could not find on the default frame. 
All I had to do was search through the iframes and find the ones that I needed.
I am trying to run some automatic scripts on a webpage with selenium and python, but the problem I'm having is that the webpage is loaded using document.write().
I have to find some elements, but they are not shown because when I view the source, it is shown as document.write(A lot of JS) instead of the html.
How can I do it so that I can view the HTML source code? I know there is the function driver.execute_script(), but I have to specify the script to run, and I don't think it will work.
The page is correctly rendered, only problem is the source cannot be parsed.