上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: # -*- coding: utf-8 -*-import sysreload(sys)sys.setdefaultencoding('utf-8') 阅读全文
posted @ 2019-08-19 19:43 Mr_Smith 阅读(333) 评论(0) 推荐(0)
摘要: sudo apt-get update sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common # step 2: 安装GPG证书 curl -fsSL http://mi 阅读全文
posted @ 2019-08-18 16:13 Mr_Smith 阅读(171) 评论(0) 推荐(0)
摘要: import execjs # eval 和 complie 是要构建一个JS的环境 e = execjs.eval('a = new Array(1,2,3)') # 可以直接执行JS代码 print(e) x = execjs.compile(''' function add(x,y){ ret 阅读全文
posted @ 2019-08-12 20:20 Mr_Smith 阅读(445) 评论(0) 推荐(0)
摘要: from scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings # 注意与scrapy.cfg在同一级目录 if __name__ == '__main__': process = CrawlerProcess(get_project_settings()) ... 阅读全文
posted @ 2019-08-12 18:33 Mr_Smith 阅读(124) 评论(0) 推荐(0)
摘要: import json import pymongo if __name__ == '__main__': client = pymongo.MongoClient(host="127.0.0.1", port=27017) # 第一种 # db = client['toy'] # # collection = db["stu"] # 第二... 阅读全文
posted @ 2019-08-06 16:20 Mr_Smith 阅读(145) 评论(0) 推荐(0)
摘要: #基础数据添加db.stu.drop() db.stu.insert({name:'郭靖',hometown:'蒙古',age:20,gender:true}) db.stu.insert({name:'黄蓉',hometown:'桃花岛',age:18,gender:false}) db.stu.insert({name:'华筝',hometown:'蒙古',age:18,gende... 阅读全文
posted @ 2019-08-05 11:15 Mr_Smith 阅读(159) 评论(0) 推荐(0)
摘要: import js2py # 实例化一个执行js的环境对象 context_js_obj = js2py.EvalJs() js_str = """ function A(a,b){ return a+b } """ # 传递js_str,执行js context_js_obj.execute(js_str) result = context_js_obj.A... 阅读全文
posted @ 2019-08-03 00:12 Mr_Smith 阅读(1301) 评论(0) 推荐(0)
摘要: import threading import time from queue import Queue from multiprocessing.dummy import Pool import requests from lxml import etree class QiuBaiSpider(object): # 1.爬取的的网站,和请求头 def __init__(s... 阅读全文
posted @ 2019-08-01 18:38 Mr_Smith 阅读(144) 评论(0) 推荐(0)
摘要: import threading import time from queue import Queue import requests from lxml import etree class QiuBaiSpider(object): # 1.爬取的的网站,和请求头 def __init__(self): self.base_url = 'https:/... 阅读全文
posted @ 2019-07-31 15:48 Mr_Smith 阅读(152) 评论(0) 推荐(0)
摘要: 代码 阅读全文
posted @ 2019-07-29 18:33 Mr_Smith 阅读(108) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 8 下一页