12 2019 档案

摘要:1、记录python读写csv文件,直接上代码 import csv header = ["学号","姓名","年龄"] values = [ ("1","zhangsan","19"), ("2","lisi","20"), ("3","wangwu","22"), ] def read_csv_ 阅读全文
posted @ 2019-12-27 17:04 高文祥888888 阅读(204) 评论(0) 推荐(0)
摘要:1、准备html文件 首先我们需要准备一个鼠标滑动的html文件,用来演示鼠标滑动的效果,注意需要将我们的html文件放在自己的服务器上, 这样我们才能够通过selenium来进行验证。html文件如下: <html> <head> <meta charset="utf-8" /> <style> 阅读全文
posted @ 2019-12-27 14:10 高文祥888888 阅读(6699) 评论(0) 推荐(1)
摘要:1、古诗文网爬虫 import requests,re headers = { "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.39 阅读全文
posted @ 2019-12-24 14:24 高文祥888888 阅读(205) 评论(0) 推荐(0)
摘要:1、元字符介绍 "^" :^会匹配行或者字符串的起始位置,有时还会匹配整个文档的起始位置。 "$" :$会匹配行或字符串的结尾 "\b" :不会消耗任何字符只匹配一个位置,常用于匹配单词边界 如 我想从字符串中"This is Regex"匹配单独的单词 "is" 正则就要写成 "\bis\b" " 阅读全文
posted @ 2019-12-23 11:11 高文祥888888 阅读(203) 评论(0) 推荐(0)
摘要:一、中国天气网爬虫案例 #中国天气网爬虫 import requests from pyecharts.charts import Bar from bs4 import BeautifulSoup import copy import html5lib datas = [] data = { "c 阅读全文
posted @ 2019-12-11 20:34 高文祥888888 阅读(221) 评论(0) 推荐(0)
摘要:BeautifulSoupeautifulSoup使用笔记 from bs4 import BeautifulSoup ''' 1、find_all的使用: soup.find_all("ul");soup.find_all("ul",limit=2)[1];find_all("ul",class_ 阅读全文
posted @ 2019-12-09 19:28 高文祥888888 阅读(379) 评论(0) 推荐(0)
摘要:#电影天堂电影爬虫import requestsfrom lxml import etreeimport timeimport warningswarnings.filterwarnings('ignore')DOMAIN = "https://dytt8.net"HEADERS = { "Refe 阅读全文
posted @ 2019-12-05 18:50 高文祥888888 阅读(820) 评论(0) 推荐(0)
摘要:一、request.get()方法 import requestsheaders = { "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78. 阅读全文
posted @ 2019-12-02 13:38 高文祥888888 阅读(1880) 评论(0) 推荐(0)