需求:从天气网站抓取天气,在每天6点,检查当天是否会下雨。如果下雨,邮件提醒带伞。代码:[root@pos ~]# cat weather.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import requests,bs4,smtplib
def sendMail
分类:
编程语言 时间:
2018-02-20 00:07:45
阅读次数:
310
# pillow图片处理from PIL import Image, ImageFilter # requests处理web请求import requests 代码量比较多 # 利用requests实现豆瓣模拟登陆from bs4 import BeautifulSoup # psutilimpor ...
分类:
编程语言 时间:
2018-02-17 14:02:01
阅读次数:
172
from selenium import webdriver import time from bs4 import BeautifulSoup url = "http://www.hsbkos.com/" soup = BeautifulSoup() soup.findAll('div',{'cl... ...
分类:
编程语言 时间:
2018-02-06 11:40:33
阅读次数:
242
一、使用字符串查找的方法find扒取教师姓名 二、使用正则表达式的方法扒取教师姓名 三、使用beautifusoup扒取学院名称 四 、使用lxml+xpath扒取京东的所有笔记本信息 五、使用webdriver扒取京东笔记本电脑的价格 ...
分类:
其他好文 时间:
2018-02-06 01:21:13
阅读次数:
213
select find和find_all有什么区别呢,请看代码: >>> ...
分类:
其他好文 时间:
2018-02-05 00:31:43
阅读次数:
2811
1 #爬虫 2 #自己写给自己看的,排版不是很好,请不要介意 3 4 import requests 5 res = requests.get('http://...')#注意是get 6 res.encoding = 'utf-8'#防治中文乱码 7 print(res.text()) 8 #pr... ...
分类:
其他好文 时间:
2018-02-03 12:51:18
阅读次数:
163
from bs4 import BeautifulSoup from bs4.element import * data = """ beatifulsoup learning note i`m son1 哈哈 ... ...
分类:
其他好文 时间:
2018-01-29 15:43:51
阅读次数:
181
python下载安装BeautifulSoup库 1、下载https://www.crummy.com/software/BeautifulSoup/bs4/download/4.5/ 2、解压到解压到python目录下: 3、“win+R”进入cmd;依次输入如下代码: 4、安装完成 5、进入py ...
分类:
编程语言 时间:
2018-01-29 11:30:57
阅读次数:
283
#coding=utf-8 import urllib.request from bs4 import BeautifulSoup from urllib import error import re def validateTitle(title): rstr = r"[\/\\\:\*\?\"\... ...
分类:
其他好文 时间:
2018-01-20 20:34:45
阅读次数:
125
#coding=utf-8 from bs4 import BeautifulSoup import urllib.request import re def validateTitle(title): rstr = r"[\/\\\:\*\?\"\\|]" # '/ \ : * ? " |' ne... ...
分类:
其他好文 时间:
2018-01-19 18:50:00
阅读次数:
153