我对此很陌生。我正在将 Eclipse SDK 与 PyQt4 一起使用(以挖掘任何被 javascript 隐藏的东西)。我正在尝试从某个站点发现指向结果的链接。例如:http ://www.mrtzcmp3.net/billy_jean_Bs.html
import sys
from PyQt4 import QtWebKit
from PyQt4 import QtCore
from PyQt4 import QtGui
class Render(QtWebKit.QWebPage):
def __init__(self, url):
self.app = QtGui.QApplication(sys.argv)
QtWebKit.QWebPage.__init__(self)
self.loadFinished.connect(self._loadFinished)
self.mainFrame().load(QtCore.QUrl(url))
self.app.exec_()
def _loadFinished(self, result):
self.frame = self.mainFrame()
self.app.quit()
url = "http://www.mrtzcmp3.net/billy_jean_Bs.html"
r = Render(url)
content = unicode(r.frame.toHtml())
print content.encode('utf-8')
编辑:这个检索到的页面源没有显示上面网址的任何下载按钮链接......从上面的代码中提取的页面源在这里: http: //pastebin.com/HyKnPUER