1 Star 0 Fork 139

pyth/scrapy-douban-group

forked from 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()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/null_688_2481/scrapy-douban-group.git
git@gitee.com:null_688_2481/scrapy-douban-group.git
null_688_2481
scrapy-douban-group
scrapy-douban-group
master

搜索帮助