title: get coordinates of an element in QWebView of QtWebKit, PyQt4 and autoscroll to its position
body: <p>Here is a a simple code which opens a site (say, yahoo.com) in <code>QWebView</code>. After finishing loading the site it scrolls to a certain position (say, <code>QPoint(100, 300)</code>). We need to wait for the site to finish loading, otherwise it wouldn't scroll automatically, hence <code>loadFinished</code> signal.</p>
  
  <p>But the question is: how can i find coordinates of an element (say 'All Stories' at yahoo.com) and automatically scroll to its position like I manually did it in the picture below? There are functions like <code>findFirstElement</code>, <code>findAllElements</code> in <code>QWebFrame</code> but I don't know how to find x, y coordinates using them?</p>
  
  <pre><code>import sys
  from PyQt4.QtCore import *
  from PyQt4.QtGui import *
  from PyQt4.QtWebKit import *
  
  def loadFinished():
      web.page().mainFrame().setScrollPosition(QPoint(100, 300))
  
  app = QApplication(sys.argv)
  web = QWebView()
  web.load(QUrl("http://yahoo.com"))
  web.connect(web, SIGNAL('loadFinished(bool)'), loadFinished)
  web.setGeometry(700, 500, 300, 500)
  web.setWindowTitle('yahoo')
  web.show()
  
  sys.exit(app.exec_())
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/1cQ4O.png" alt="enter image description here"></p>