我编写了脚本,从我的帐户中收集一些对我有用的数据。我在 Windows 上运行它,一切正常。但我无法在 linux 上运行它(没有 gui)。
我安装了 pyqt4、spynner 和所有必要的依赖项。问题是:
对象没有属性 findfirstelement。
据我了解, qwebframe 对象无法与浏览器一起使用。之后我安装了 firefox 和 chromiumb,但它不起作用。我是先安装浏览器吗?我运行脚本 inxvfb,因为我没有 x11
xvfb-运行 python ...py
[更新]
Traceback (most recent call last):
File "ebay_reports_retriver.py", line 392, in <module>
main()
File "ebay_reports_retriver.py", line 375, in main
downloadReportsFromPublishers.getReport()
File "ebay_reports_retriver.py", line 228, in getReport
downloadReportsFromPublishers.downloadReports(url,username,password, counter)
File "ebay_reports_retriver.py", line 183, in downloadReports
browser.wk_fill("input[type=text]", username)
File "/usr/lib/python2.6/site-packages/spynner/browser.py", line 1158, in wk_fill
element = self.webframe.findFirstElement(selector)
AttributeError: 'QWebFrame' object has no attribute 'findFirstElement'
rpm -qa | grep qt
qt-4.6.2-28.el6_5.x86_64
qt-sqlite-4.6.2-28.el6_5.x86_64
qt-x11-4.6.2-28.el6_5.x86_64
zlibrary-ui-qt-0.12.10-5.el6.x86_64
qtwebkit-2.1.1-1.el6.x86_64
qt-devel-4.6.2-28.el6_5.x86_64
qt-mobility-1.1.3-2.el6.x86_64
[UPD2]
Traceback (most recent call last):
File "ebay_reports_retriver.py", line 2, in <module>
import urllib , cookielib , spynner
File "/opt/python27/lib/python2.7/site-packages/spynner/__init__.py", line 2, in <module>
from .browser import *
File "/opt/python27/lib/python2.7/site-packages/spynner/browser.py", line 52, in <module>
from PyQt4 import QtCore
ImportError: /opt/python27/lib/python2.7/site-packages/PyQt4/QtCore.so: undefined symbol: PyUnicodeUCS4_FromUnicode