使用Python进行Wall Web Scraping

时间:2013-06-29 23:59:28

标签: python web-scraping

我很陌生。我正在使用带有PyQt4的Eclipse SDK(用于挖掘任何被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

0 个答案:

没有答案