Now i open a URL by QWebView in my PyQt code, then i want to trigger a click on an anchor, the anchor code is below:
Qt Code:
  1. <a class="btn-bid" href="javascript:;" id="exchange-btn" data-sk="exchange">exchange</a>
To copy to clipboard, switch view to plain text mode 
and this is my code below:
Qt Code:
  1. code = """
  2. document.getElementById("exchange-btn").click()
  3. """
  4. self.view.page().mainFrame().evaluateJavaScript(code)
To copy to clipboard, switch view to plain text mode 
but is did not work for me.
I try the code :document.getElementById("exchange-btn").click() in Firefox and one other browser console(by F12), the code works fine.

There is some error in my code or something missing? My Qt version is 4.8.6 and we can not use jquery in this webpage.
Is there someone can tell me how to solve this problem??