2018年8月23日

恋家-bs4

摘要: from bs4 import BeautifulSoup import requests from day3.mysql_test import mysql_conn mc = mysql_conn() url = 'https://zh.lianjia.com/zufang/rp5/' response = requests.get(url) # with open('lianjia... 阅读全文

posted @ 2018-08-23 09:05 Pyton当歌人生几何 阅读(96) 评论(0) 推荐(0) 编辑

2018年8月21日

豆瓣有无验证码登陆+selenium

摘要: from selenium import webdriver import time import requests from lxml import etree import base64 # 操作浏览器 driver = webdriver.Chrome() url = 'https://accounts.douban.com/login?alias=&redir=https%3A%2F%... 阅读全文

posted @ 2018-08-21 21:07 Pyton当歌人生几何 阅读(291) 评论(0) 推荐(0) 编辑

2018年8月20日

进程,线程

摘要: 一个程序就是一个进程,而一个程序中的多个任务则被称为线程。进程是表示资源分配的基本单位,又是调度运行的基本单位。线程是进程中执行运算的最小单位,亦即执行处理机调度的基本单位。 进程和线程的关系(1)一个线程只能属于一个进程,而一个进程可以有多个线程,但至少有一个线程。线程是操作系统可识别的最小执行和 阅读全文

posted @ 2018-08-20 21:56 Pyton当歌人生几何 阅读(126) 评论(0) 推荐(0) 编辑

西祠代理——检测代理使用

摘要: import requests from lxml import etree url = 'http://www.xicidaili.com/' headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.... 阅读全文

posted @ 2018-08-20 21:55 Pyton当歌人生几何 阅读(1139) 评论(0) 推荐(0) 编辑

2018年8月18日

我爱我家-北京-mysql

摘要: import requests from lxml import etree from day3.mysql_test import mysql_conn myhelper = mysql_conn() sql = 'insert into woaiwojia(target,title,title_1,title_3,strong) values (%s, %s, %s ,%s, %s)' ... 阅读全文

posted @ 2018-08-18 12:26 Pyton当歌人生几何 阅读(142) 评论(0) 推荐(0) 编辑

2018年8月17日

喜马拉雅-春秋

摘要: import requests from lxml import etree from urllib import parse url = 'https://www.ximalaya.com/lishi/4164479/' headers = { 'user-agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.3... 阅读全文

posted @ 2018-08-17 16:41 Pyton当歌人生几何 阅读(82) 评论(0) 推荐(0) 编辑

正则 {} | 【】

摘要: import re # line = 'ahhuuhhaaahhhhang123' #line = 'ahuuuhuuu' # 需要获取h和h之间,需要包含特定数量字符的子串 # 使用 + h和h之间至少要有一个字符 # {} 限定它前面出现的那个东西的出现次数 # match_res = re.search('h.{3,6}h', line) # if match_res: # ... 阅读全文

posted @ 2018-08-17 00:05 Pyton当歌人生几何 阅读(554) 评论(0) 推荐(0) 编辑

2018年8月16日

今日头条三页内容-添加数据库篇

摘要: import requests import re import json # import os # from urllib import request from day3.mysql_test import mysql_conn hearders = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit... 阅读全文

posted @ 2018-08-16 23:49 Pyton当歌人生几何 阅读(446) 评论(0) 推荐(0) 编辑

今日头条三页内容-创建文件夹篇

摘要: import requests import re import json import os from urllib import request hearders = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.339... 阅读全文

posted @ 2018-08-16 23:36 Pyton当歌人生几何 阅读(395) 评论(0) 推荐(0) 编辑

雪球数据爬取上传数据库

摘要: import json import requests import pymysql from mysql_test import mysql_conn # 因为不能访问, 所以我们加个头试试 headers = { #'Accept': '*/*', #'Accept-Encoding': 'gzip, deflate, br', #'Accept-Language'... 阅读全文

posted @ 2018-08-16 00:14 Pyton当歌人生几何 阅读(149) 评论(0) 推荐(0) 编辑

导航