Python
如无必要,勿增实体
如无必要,勿增实体
展开
-
Python实现通讯录按首字母分组以及中文转英文
import timeimport datetimeimport SomeModelimport itertoolsimport pinyin#print()names=[]names_o = ['杨照亮','岳飞','沙僧','武松','武大郎','杨六郎'] #通讯录for name in names_o: names.append(pinyin.get(name,...原创 2018-11-16 09:18:58 · 712 阅读 · 0 评论 -
python 实现抓取孔夫子旧书网图书图片
import requestsfrom bs4 import BeautifulSoupfrom fake_useragent import UserAgentimport json#孔夫子旧书网图书信息抓取def getImg(isbn): ua = UserAgent() headers = {'User-Agent':ua.random} url = 'h...原创 2018-11-16 09:21:56 · 1252 阅读 · 0 评论 -
python 文轩网图书信息抓取
import requestsfrom bs4 import BeautifulSoupfrom fake_useragent import UserAgent#文轩网图书信息抓取def getImg(isbn): url = 'http://search.winxuan.com/search?keyword='+isbn+'&type=' ua = UserAg...原创 2018-11-16 09:23:31 · 448 阅读 · 0 评论 -
python京东图书信息抓取
import requestsfrom bs4 import BeautifulSoupfrom fake_useragent import UserAgent#京东图书信息抓取def getImg(isbn): url = 'https://search.jd.com/Search?keyword='+isbn+'&enc=utf-8&pvid=ce5ca7fd...原创 2018-11-16 09:24:58 · 1414 阅读 · 0 评论 -
python当当图书信息抓取
import requestsfrom bs4 import BeautifulSoupfrom fake_useragent import UserAgentimport time#当当图书信息抓取def getdangdang(isbn): ua = UserAgent() headers = {'User-Agent':ua.random} url = '...原创 2018-11-16 09:34:19 · 1073 阅读 · 0 评论 -
python连接mysql 数据库
import pymysqlimport pandas as pdimport re#pd_data = pd.read_excel('')def connection(): db = pymysql.connect(host='localhost',user='root',password='111111',db='salebook') cursor = db.cur...原创 2018-11-16 09:44:06 · 271 阅读 · 0 评论