自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

SCUTJcfeng的博客

Python 123

  • 博客(48)
  • 收藏
  • 关注

原创 Python 下载哔哩哔哩视频

Python 下载哔哩哔哩视频源码见Github 链接欢迎留言讨论说明支持按 Up 下载和按 av 号下载例子要下载凉风所有阅片无数的视频# up id,比如凉风 14110780UP_ID = 14110780# 关键词,如 KEYWORD = '阅片无数' 查看所有带有阅片无数标题的视频KEYWORD = '阅片无数'# 视频顺序,关联 up id 和 keywor...

2020-02-16 17:58:39 3295

原创 中国裁判文书网爬虫分析

前言本篇主要分析文书网爬虫思路,仅供个人学习之用,切勿用于任何商业用途。分析一中国裁判文书网首页地址:http://wenshu.court.gov.cn/ 随便点击一下搜索,进入: 进入第一个结果: 注意圆圈中的下载按钮,点击下载,一个.docx格式的文档就安安稳稳的躺在你的电脑硬盘上了。 到这里初步分析结束,我们自然就想到了爬虫的内容: ...

2018-05-01 23:28:09 8709 8

原创 Python Fabric模块介绍

前言最近有一个需求,需要在服务器执行命令,结果需要返回本地,中间涉及到配置文件的传输,一开始我想到的是Paramiko,后来联想起之前一段时间在公众号看到Fabric,便研究了一下,最后发现Fabric能优雅的完成我的需求,脚本已经开发完成,稳定运行了一段时间,现在总结一下。介绍Fabric官方文档:http://docs.fabfile.org/en/2.4/index.htmlFab...

2019-01-12 11:28:24 1380

原创 新浪GIF下载

前言最近偶然发现新浪动图的其中一个接口,就顺便写了一个脚本定时把动图拿下来。接口地址:https://interface.sina.cn/tech/gif/album.d.jsonKnown Issues:只能拿到最近的1000条数据代码块#!/usr/bin/python3# -*- coding:utf-8 –*-import osimport timeimport ...

2019-01-12 10:43:19 864

原创 LeetCode:657. Judge Route Circle

链接: https://leetcode.com/problems/judge-route-circle/description/题目: Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means ...

2018-04-30 15:45:43 343

原创 LeetCode:461. Hamming Distance

链接: https://leetcode.com/problems/hamming-distance/description/题目:The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two in...

2018-04-29 15:22:59 294

原创 LeetCode:804. Unique Morse Code Words

链接: https://leetcode.com/problems/unique-morse-code-words/description/题目: International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follow...

2018-04-29 11:33:27 271

原创 LeetCode:626. Exchange Seats

链接: https://leetcode.com/problems/exchange-seats/description/题目: Mary is a teacher in a middle school and she has a table seat storing students’ names and their corresponding seat ids.The column...

2018-04-29 10:53:23 1086

原创 Linux个人常用指令

前言最近在Linux学习部署爬虫项目,部分Linux指令用的比较频繁,记下来待后续补充。指令列表后台运行任务 格式:cd 目录路径 && nohup 命令 >> 输出log目录 2>&1 & 例子:cd ~/scrapyprojects/jdcomment/jdcomment && nohup scrapy c...

2018-04-26 23:24:26 211

原创 Navicat连接阿里云Mysql

注意: 1. 不能用Navicat自带的连接阿里云云数据库Mysql版连接数据库,用普通的Mysql连接即可; 2. 主机和端口选择数据库外网地址和外网端口,用户名和密码填写数据库的用户名和密码; 3. SSL和其它保持默认不需要填写; 4. Navicat版本号:12.0.18 64位。...

2018-04-25 12:05:31 811

原创 插入Json数据到Mysql

前言MySQL 5.7已经原生支持JSON格式,我在插入Json数据的时候出错了,出错的过程记录一下。过程错误:Invalid JSON text: "Invalid escape character in string." at position...分析:原来是数据自带了'\r\n'这样的换行符号。用replace()替换掉对应的转义字符。延伸:escape cha...

2018-04-24 23:06:44 6342

原创 Python爬虫云服务器搭建系列之二:环境搭建

前言上篇在这里: Python爬虫云服务器搭建系列之一:环境搭建本篇主要介绍阿里云的云服务器ECS和云数据库EDS,先贴配置图吧: 0x00:搭建过程在上一篇文章已经介绍了云服务器ECS的登陆和部分爬虫模块的安装,现在继续:网页端登陆控制台,到左侧选择云服务器RDS版,点击实例id,根据提示创建用户(因为只能创建这一个用户,所以我的截图没有这个提示); 点击数据...

2018-04-24 21:27:01 933

原创 Python爬虫云服务器搭建系列之一:环境搭建

简介本文所用到的云服务器是阿里云:Ubuntu 16.04 64位。0x00:创建实例并启动服务器本节跳过0x01:登陆服务器工具:putty 安装putty后输入ip和port(默认22),连接类型选择SSH(默认),保存save session,下次直接进入。 完了后点击open 输入账号密码: 账号默认为root,密码可以到网页端ecs实例-更多-...

2018-04-24 11:47:08 4315

原创 Scrapy-redis学习系列之一:初识scrapy-redis

Scrapy-redis学习系列之一:初识scrapy-redis写在最前本项目Github地址:https://github.com/SCUTJcfeng/Scrapy-redis-Projects一、scarpy-redis介绍scrapy-reids官方介绍的三个特性如下:Distributed crawling/scraping(分布式爬虫)You ca...

2018-04-23 19:36:33 683

原创 Redis在Windows下创建多个实例(2018最新)

Redis在Windows下创建多个实例(2018最新)前言网上看了很多关于单机创建Redis多实例的文章,都是不适用的(可能只适用以前的版本),经过自己一翻琢磨,终于琢磨出来了,现在记录一下。一、版本Windows10 64位,Redis-x64-3.2.100.msi二、步骤思路:将Redis进程添加到Windows服务中。(以我自身举例,创建一个端口为...

2018-04-22 23:10:45 2476

原创 Ubuntu Recovery下卸载Kodi

Ubuntu Recovery下卸载Kodi事情源于我今天在Ubuntu自带的软件应用下载安装了Kodi,重启电脑后直接进入Kodi,即kodi已经替代了桌面,没法进入桌面怎么玩?所以我们需要在Recovery下卸载Kodi。1、reboot,在grub引导界面进入Ubuntu Recovery模式,再进入root命令行界面。2、输入mount -o remount,r...

2018-04-22 13:14:47 1486

原创 Redis在Ubuntu和Windows下的安装

Redis在Ubuntu和Windows下的安装过程前言今天(2018年4月21日),我在我的Ubuntu 17.10和Windows 10双系统都安装上了Redis,简单记录一下过程。一、windows下的安装:其实,redis官方最新版4.0.9已经不支持Windows,现在在微软的Github仓库上能找到最新的就是3.2.100,这是微软维护的最后一个版本。进入...

2018-04-21 23:48:46 570

原创 LeetCode:771. Jewels and Stones

题目: You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of th...

2018-04-20 23:24:40 322

原创 LeetCode:196. Delete Duplicate Emails

题目: Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id.+—-+——————+ | Id | Email | +—-+——————+ | 1 | ...

2018-04-20 21:44:25 216

原创 LeetCode:596. Classes More Than 5 Students

题目: There is a table courses with columns: student and classPlease list out all classes which have more than or equal to 5 students.For example, the table:+———+————+ | student | class | ...

2018-04-20 17:53:54 170

原创 LeetCode:197. Rising Temperature

题目: Given a Weather table, write a SQL query to find all dates’ Ids with higher temperature compared to its previous (yesterday’s) dates.+———+——————+——————+ | Id(INT) | RecordDate(DATE) | Temperat...

2018-04-20 17:17:55 158

原创 LeetCode:183.Customers Who Never Order

题目: Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything.Table: Customers.+—-+——-+ | Id | Name ...

2018-04-20 16:27:00 146

原创 天猫评论爬取系列之Bra特别篇

天猫评论爬取系列之Bra特别篇(钢铁直男勿进)封面图镇楼~1 前言1.1 目的爬虫真是好玩:) 在一个阳光明媚的中午,刚吃完饭的我坐在电脑桌前,翻着手机,忽然看到这样一条微信公众号推送(图是后来截的): 嗯~ o( ̄▽ ̄)o,又可以涨知识了,开干吧(只看分析请跳到最后)。1.2 相关工具 Chrome:抓包、浏览器 scrapy:爬虫框...

2018-04-20 15:55:04 840 2

原创 LeetCode:181. Employees Earning More Than Their Managers

题目: The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.+—-+——-+——–+———–+ | Id | Name | Salary | ManagerId | ...

2018-04-19 23:30:12 195

原创 LeetCode:175. Combine Two Tables

题目: Table: Person+————-+———+ | Column Name | Type | +————-+———+ | PersonId | int | | FirstName | varchar | | LastName | varchar | +————-+———+ PersonId is the primary key colum...

2018-04-19 22:05:12 193

原创 LeetCode:182. Duplicate Emails

题目: Write a SQL query to find all duplicate emails in a table named Person.+—-+———+ | Id | Email | +—-+———+ | 1 | [email protected] | | 2 | [email protected] | | 3 | [email protected] | +—-+———+ For example, your qu...

2018-04-19 21:08:44 174

原创 LeetCode:620. Not Boring Movies

题目: X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a poster indicating the movies’ ratings and descriptions. Please write a SQL query to output mo...

2018-04-19 17:49:18 197

原创 LeetCode:627. Swap Salary

题目: Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and vice versa) with a single update query and no interme...

2018-04-19 17:33:00 233

原创 LeetCode:176. Second Highest Salary

题目: Write a SQL query to get the second highest salary from the Employee table.+—-+——–+ | Id | Salary | +—-+——–+ | 1 | 100 | | 2 | 200 | | 3 | 300 | +—-+——–+ For example, given t...

2018-04-19 17:15:22 219

原创 LeetCode:7. Reverse Integer

题目: Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123 Output: 321Example 2:Input: -123 Output: -321Example 3:Input: 120 Output: 21Note: Assume we are ...

2018-04-19 16:18:12 136

原创 LeetCode:665. Non-decreasing Array

题目: Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element.We define an array is non-decreasing if array[i] <= array[i + 1] holds ...

2018-04-19 14:07:20 138

原创 LeetCode:Add Two Numbers

题目: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and ret...

2018-04-18 22:13:25 150

原创 LeetCode:Reverse Linked List(单链表反转)

Question: Reverse a singly linked list.(单链表反转)Answer:(42ms)# Definition for singly-linked list.# class ListNode(object): # def __init__(self, x): # self.val = x # self.next =...

2018-04-18 16:27:18 249

原创 LeetCode:Two Sum

题目: Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the ...

2018-04-18 14:58:58 249

转载 Python self参数 & 函数详解

在介绍Python的self用法之前,先来介绍下Python中的类和实例…… 我们知道,面向对象最重要的概念就是类(class)和实例(instance),类是抽象的模板,比如学生这个抽象的事物,可以用一个Student类来表示。而实例是根据类创建出来的一个个具体的“对象”,每一个对象都从类中继承有相同的方法,但各自的数据可能不同。 1、以Student类为例,在Python中,定义类如下:cla...

2018-04-01 22:44:39 2862

原创 网易云音乐评论生成Wordcloud(词云)

网易云音乐评论生成Wordcloud(词云)1 前言1.1 目的本篇主要介绍网易云音乐爬取歌曲知足的评论生成词云,可以结合新浪微博生成词云学习。1.2 工具Wordcloud 词云(pip install wordcloud安装即可)jieba 分词(pip install jieba安装即可)第三方网易云API(需配合node.js食用):https://git...

2018-03-28 16:26:42 1847

原创 新浪微博生成词云

新浪微博生成Wordcloud(词云)1 前言1.1 目的本篇主要介绍新浪微博内容生成Wordcloud(词云),我举了一个炒鸡简单的例子。1.2 工具Wordcloud 词云(pip install wordcloud安装即可)jieba 分词(pip install jieba安装即可)1.3 相关网址 Wordcloud API Referenc...

2018-03-27 22:09:04 10007

原创 github解决端口22不能连接错误

github解决端口22不能连接错误真是奇怪了,之前用Git好好的,几天没用回来发现ssh -T [email protected]一直连不上…搞了半天,终于连上了,记录一下过程,留个记录。修改下面这个文件(Git默认安装目录)C:\Program Files\Git\etc\ssh\ssh_config添加以下内容Host github.comUser jcfen...

2018-03-15 19:23:40 4505 7

转载 Redis

Redis注:关于Redis的介绍,原文转载于Github,版权归江南白衣所有。版本:V3.1 2014-3-36 (@江南白衣版权所有,转载请保留出处),针对Redis 2.8版。1. Overview1.1 资料< The Little Redis Book > ,最好的入门小册子,可以先于一切文档之前看,免费。[作者Antirez的博客] (htt...

2018-03-14 22:49:11 315

原创 Scrapy学习系列之Selenium + Chrome + Xpath实践记录

源代码见个人Github:https://github.com/SCUTJcfeng/ScrapyProjectslagouPCJobs本项目主要通过Selenium + Chrome + Xpath 爬取拉勾网职位列表,结果同样输出到CSV文件。Known Issue: 1. 会出现最后一页或者还不到最后一页时,停止翻页,但数据还在写入(endless),必须强制关闭程序,造成大量...

2018-03-13 17:23:03 1539

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除