最近突然想到以前爬取百度学术上的参考文献,大家可以看一下以前我的写的博客:http://www.cnblogs.com/ybf-yyj/p/7351493.html,但是如果利用这个方法,太痛苦了,需要人工来复制粘贴,所以这里来介绍用selenium来实现这个功能,贴上代码: 注意: 代码中红色标注 ...
分类:
编程语言 时间:
2017-10-22 21:33:55
阅读次数:
229
#验证码图片的src常用的Data URI scheme: from io import BytesIO from PIL import Image import base64,requests url='https://my.fengjr.com/api/v2/captcha?_ts=350455 ...
分类:
其他好文 时间:
2017-10-19 19:57:45
阅读次数:
260
1.结构化: 单条新闻的详情字典:news 一个列表页所有单条新闻汇总列表:newsls.append(news) 所有列表页的所有新闻汇总列表:newstotal.extend(newsls) 2.转换成pandas的数据结构DataFrame 3.从DataFrame保存到excel 4.从Da ...
分类:
其他好文 时间:
2017-10-19 12:37:02
阅读次数:
147
import requests from bs4 import BeautifulSoup from datetime import datetime import re import pandas import sqlite3 url = 'http://news.gzcc.cn/html/xia... ...
分类:
其他好文 时间:
2017-10-19 12:32:12
阅读次数:
138
趴房源 import requestsfrom bs4 import BeautifulSoup # 网页的请求头header = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, lik ...
分类:
其他好文 时间:
2017-10-19 10:34:14
阅读次数:
231
import requests from bs4 import BeautifulSoup from datetime import datetime import re def getclick(newsurl): num = re.search('_(.*).html',newsurl) id ... ...
分类:
其他好文 时间:
2017-10-18 20:01:56
阅读次数:
124
#encoding:utf-8 import urllib import urllib2 import cookielib from bs4 import BeautifulSoup filename = 'cookie_csdn.txt' #声明一个MozillaCookieJar对象实例来保存c... ...
分类:
编程语言 时间:
2017-10-18 13:16:51
阅读次数:
172
阿里云服务器租用费用价格表多少钱?阿里云服务器租赁是否优惠? 本文为大家介绍阿里云服务器的价格,让大家以最少的钱,最优惠的价格,买到最合适最便宜的阿里云服务器。 阿里云服务器又称为阿里云ECS。 阿里云服务器的租用价格,主要是根据cpu,内存,带宽,磁盘确定的。大家在购买阿里云服务器的时候,当你选择 ...
分类:
其他好文 时间:
2017-10-15 14:48:41
阅读次数:
1034
from bs4 import BeautifulSoupimport urllib.parseimport reimport requestsimport time index = 0session = requests.session()f = open('C:\\Users\\Administ ...
分类:
其他好文 时间:
2017-10-13 17:53:42
阅读次数:
211
import requests from bs4 import BeautifulSoup a=requests.get('http://news.gzcc.cn/html/xiaoyuanxinwen/') a.encoding='utf-8' soup=BeautifulSoup(a.text,... ...
分类:
其他好文 时间:
2017-10-12 21:43:40
阅读次数:
147