我已经安装了 https://github.com/muhuk/python-awis以便从 alexa 获取 url 信息。我已经通过python setup.py install
从终端运行来安装它。
当我尝试运行脚本时,我收到此错误:
Traceback (most recent call last):
File "pst.py", line 4, in <module>
api = AwisApi(ACCESS_ID,SECRET_ACCESS_KEY)
NameError: name 'AwisApi' is not defined
我正在使用以下代码来运行脚本:
api = AwisApi(ACCESS_ID, SECRET_ACCESS_KEY)
tree = api.url_info("www.domain.com", "Rank", "LinksInCount")
elem = tree.find("//{%s}StatusCode" % api.NS_PREFIXES["alexa"])
assert elem.text == "Success"
我必须导入一些东西吗?我错过了一些东西。