- 博客(11)
- 资源 (1)
- 收藏
- 关注
原创 数据库存储方式:MySQL存储、MONGODB存储、Redis存储、json存储、视频存储、图片存储
1.mongo存储导包开始mongo数据库import pymongo链接db = pymongo.MongoClient()['zhe']['lll']dicts={ 'name':(变量名)}db.insert(dicts)2:MySQL存储py文件中的操作连接开启mysql数据库connect = pymysql.connect( ...
2018-10-12 14:25:20 2470
原创 存储Mongo数据库的简单步骤
import pymongodb = pymongo.MongoClient()['mongo数据库的名字']['mongo数据库的表名']dicts={ '存的名字':变量名}db.insert(dicts)
2018-07-20 20:26:18 291
原创 爬虫——简单的小代码 自动打开运行
from selenium import webdriverimport timename = webdriver.Chrome('D:\\Pachong\\chromedriver.exe')name.get('https://www.jd.com/?cu=true&utm_source=baidu-pinzhuan&utm_medium=cpc&utm_campa...
2018-05-15 21:04:37 2031
原创 爬虫——爬取淘宝搜索信息
import reimport requestsimport urllib.requestfrom bs4 import BeautifulSoup# headers_set = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',# ...
2018-05-10 19:21:31 2165 1
原创 爬虫——豆瓣登录
import urllib.requestfrom selenium import webdriverfrom PIL import Imageimport reimport timeurl = 'http://accounts.douban.com/login'email = input('E-mail:')password = input('Password:')brows...
2018-05-10 19:20:06 371
原创 爬虫——爬取造句网
import pymongoimport requestsfrom bs4 import BeautifulSoupClient = pymongo.MongoClient('localhost', 27017)Db = Client.zaojvMy_Collection = Db.clauseUrl_Init = 'http://zaojv.com/word.html'Res...
2018-05-10 19:18:20 871
原创 爬虫——爬取证券交易数据
import requestsfrom multiprocessing.dummy import Pool as ThreadingPoolfrom lxml import etreefrom pymongo import MongoClientUrl = 'http://www.szse.cn/main/marketdata/jypz/colist/ 'def Write_To_Mon...
2018-05-10 19:17:31 7467 1
原创 爬虫——爬取糗事百科 信息
import requestsimport pymongofrom bs4 import BeautifulSoupfrom multiprocessing.dummy import Pool as ThreadPoolClient = pymongo.MongoClient('localhost', 27017)Db = Client.qiushibaikeMy_Collec...
2018-05-10 19:14:20 177
原创 爬虫——爬取猫眼电影网
import jsonfrom multiprocessing import Poolimport requestsfrom requests.exceptions import RequestExceptionimport redef get_one_page(url): try: headers={"user-agent":'Mozilla/5.0 (Wi...
2018-05-10 19:12:09 1769
原创 爬虫——BeautifulSoup 淘宝模特信息爬取
(仅供参考)import osimport requestsfrom bs4 import BeautifulSoupfrom selenium import webdriverPath_Dir = "D:\\Pachong\\shuju" if os.path.exists(Pa...
2018-05-10 19:10:06 1054
原创 爬虫——爬取QQ空间
import refrom selenium import webdriverimport timedriver = webdriver.PhantomJS(executable_path="E:\\spider\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe")# 响应Windows全屏driver.maximize_window()u...
2018-05-10 19:04:12 1705
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人