
爬虫
moss flora
tiny leafy-stemmed flowerless plants.
展开
-
wos文章标题、发表年份、被引次数、作者、citation等数据爬取
之前参照另一个博主的代码思路改动后写的爬取wos文章标题、发表年份、被引次数、作者、citation等数据的代码,写完以后发现该代码实现的功能可以通过在wos中直接导出实现(只需要写一段selenium代码),更加方便,所以这段代码放在这里做一个练习参考。爬取得到的txt文件格式如下:Learning Deep Architectures for AI,Bengio Y.,Foundations and Trends in Machine Learning, 2009,3847,,A study o原创 2021-09-02 11:33:03 · 2299 阅读 · 1 评论 -
urllib/urllib2/requests/BeautifulSoup的使用
urllibimport urlliburl = 'http://www.someserver.com/cgi-bin/register.cgi'user_agent='Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'values = {'name' : 'Michael Foord', 'location' : 'Northampton', 'language' : 'Python' }headers = {原创 2021-09-02 11:14:21 · 211 阅读 · 0 评论 -
一个简单的豆瓣评论爬取
# encoding: utf-8import urllib2from bs4 import BeautifulSoupimport timeimport randomdef get_data(html,i): i+=1 soup=BeautifulSoup(html,'lxml') comment_list=soup.select('.comment>p') #对返回的数据使用BeautifulSoup进行解析,从中找到comment标记符所在位置 ne原创 2021-09-02 11:09:19 · 333 阅读 · 0 评论 -
Warning:InsecureRequestWarning: Unverified HTTPS request is being made
爬虫爬取的时候出现的warning,不影响使用,但是看得有点脑瓜子疼。InsecureRequestWarning: Unverified HTTPS request is being made to host ‘webvpn.dlut.edu.cn’. Adding certificate verification is strongly advised.尝试使用网上推荐的方法from requests.packages.urllib3.exceptions import InsecureReque原创 2021-01-15 17:20:43 · 1239 阅读 · 0 评论 -
python selenium后台开启浏览器
python selenium后台开启浏览器#后台开启浏览器def openChrome(): # 加启动配置 option = webdriver.ChromeOptions() option.add_argument('headless') # 打开chrome浏览器 driver = webdriver.Chrome(chrome_options=option) return driver只需添加option.add_argument(‘head原创 2021-04-13 13:34:57 · 1104 阅读 · 0 评论