dealing with html source vs browser dom
===

I'm building a scraper in ruby using nokogiri and I noticed that sometimes the dom created by parsing the source and the dom when the browser parses the source are different.

For example, the browser adds in tbody tags, the browser can modify tags if the document is not well formed or if javascript makes runtime changes.

The problem is that I am getting the desired element path from the browser dom (using an element inspector at this stage) but when I search for that element in the dom from parsing the source nothing is found because of these differences.

Is it possible to get the same dom as the browser and if so, how?