1 Star 0 Fork 192

步洛格 / PythonClimbInsect

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ghostCartoon.py 695 Bytes
一键复制 编辑 原始数据 按行查看 历史
振长策而御宇内 提交于 2014-01-20 09:10 . ghost
# -*- coding:utf8 -*-
#!/usr/bin/python
from ghost import Ghost
class FetcherCartoon:
def getCartoonUrl(self,url):
if url is None:
return false
#todo many decide about url
ghost = Ghost()
#open webkit
ghost.open(url)
#exceute javascript and get what you want
result, resources = ghost.evaluate("document.getElementById('cpimg').getAttribute('src');")
del resources
return result
if __name__ == "__main__":
url = 'http://www.1kkk.com/ch1-93986/'
result = None
fetcher = FetcherCartoon()
result = fetcher.getCartoonUrl(url)
print result
Python
1
https://gitee.com/blogsaving/PythonClimbInsect.git
git@gitee.com:blogsaving/PythonClimbInsect.git
blogsaving
PythonClimbInsect
PythonClimbInsect
master

搜索帮助