True, as user110977 has said: The code in inspect element changes based on the [executed in browser] javascript of a page, that is why it is different.
Basically you need a scripting language that will invoke a browser instance with all the javascript-evaluated code. Use any server side language (python, java, php...) that will run Selenium or PhantomJS for that.
In addition to this you might be interested in this picture, of how to copy/paste the browser code.
Update
Can python extract inspect element content line by line?
No. Python is the server-side programming language, not executing any javascript of a scraped page. While the inspect element panel (more correct - browser developer tools) presents a javascript evaluated html code to developers. If you invoke a browser instance thru Selenium (or PyQt), that [virtual] browser will content all the javascript evaluated code. That's where you access the code that you need.