125 Star 356 Fork 138

mktime / scrapy-douban-group

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
crawl_us_phantomjs.py 628 Bytes
一键复制 编辑 原始数据 按行查看 历史
from selenium import webdriver
import requests
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
def traditional():
url = "http://zhuanlan.zhihu.com/Weekly/20443867"
req = requests.get(url)
open("zhihu.html", "w").write(req.text)
def demo():
driver = webdriver.PhantomJS()
#driver = webdriver.Chrome()
driver.get("http://zhuanlan.zhihu.com/Weekly/20443867")
print driver.page_source
print driver.title
print driver.current_url
open("zhihu.html", "w").write(driver.page_source)
driver.save_screenshot("zhihu.png")
if __name__ == '__main__':
demo()
#traditional()
Python
1
https://gitee.com/mktime/scrapy-douban-group.git
git@gitee.com:mktime/scrapy-douban-group.git
mktime
scrapy-douban-group
scrapy-douban-group
master

搜索帮助