
爬虫
chde2Wang
滴水穿石
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
VScode中编写运行C/html文件
VScode运行C程序的所需配置 VScode只是一个编辑器,并不自带C编译器,所以需要 下载mingw 下载安装版本或者压缩文件,解压缩后,配置系统的环境变量。 path中添加mingw/bin的路径 新建include变量,添加mingw/include的路径 打开VScode安装c/c++插件和code runner插件 code runner用来一键编译运行C程序。 当运行html文件时: 下载:open in browser即可,当编辑好html文件后,右击文件,选择:op原创 2021-05-12 23:07:03 · 589 阅读 · 0 评论 -
爬虫-淘宝
import bs4 import requests import xlwt import datetime params={ 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36' } date = datetime.datetime.now().strftime('%Y-%m-%d') # 给文件打上时间.原创 2021-05-11 14:41:35 · 197 阅读 · 0 评论 -
数据清洗-python实践
# -*- coding: utf-8 -*- import pymysql import numpy as npy import pandas as pda import matplotlib.pylab as pyl import matplotlib.pyplot as plt #导入数据 conn=pymysql.connect(host="127.0.0.1",user="root",passwd="123456",db="爬虫111") sql="select * from taob" d.原创 2021-04-26 21:31:03 · 259 阅读 · 0 评论 -
爬虫5-BeautifulSoup模块简解2
1.BeautifulSoup简解2 from bs4 import BeautifulSoup import re file = open("./baidu.html",'rb') html = file.read() bs = BeautifulSoup(html,"html.parser") # 解析内容 解析器 # 1 Tag 标签及其内容:拿到它所找到的第一个内容 print(bs.title) # <title>Title</title> print(bs.原创 2021-04-23 16:44:48 · 182 阅读 · 0 评论 -
爬虫5-BeautifulSoup模块简解
1、html标记语言了解 <html> <meta http-equiv="Content-Type"content="text/html;charset=utf-8"> <h1>我的祖国</h1> <h1 align="center">我的祖国</h1> # h1 标签 # align 属性 # center 属性值 <标签 属性="属性值">被标记的内容</标签> <img src="xxx.jp原创 2021-04-23 00:17:25 · 160 阅读 · 0 评论 -
html文件中文在浏览器中显示乱码问题解决
利用浏览器打开html文件时,中文显示乱码,如下是原文件的内容 1 <html> 2 <head> 3 <title>狗熊王</title> 4 </head> 5 6 <body> 7 <p>狗熊王</p> 8 <p>http://blog.cs...转载 2021-04-22 23:00:03 · 579 阅读 · 0 评论 -
爬虫4-正则表达式及Python的re模块
正则表达式语法: # -*- coding: utf-8 -*- 元字符:具有固定含义的特殊符号 常用元字符:(一般一次匹配一个字符) . 匹配除换行符以外的任意字符 \w 匹配字母数字或下划线 \s 匹配任意的空白符 \n 匹配一个换行符 \t 匹配一个制表符 ^ 匹配字符串的开始 $ 匹配字符串的结尾 \W 匹配非字符或数字或下划线 \D 匹配非数字 \S 匹配非空白符 a|b 匹配字符a或字符b () 匹配括号内的表达式,也表示一个组 [...] 匹配字符组中的字符 [^...] 匹配除了字符原创 2021-04-20 23:59:42 · 117 阅读 · 0 评论 -
爬虫3-request的get与post简单使用
requests.get # 安装request pip install requests # import requests # url = "http://www.sogou.com/web?query=周杰伦" # resp = requests.get(url) # 地址栏链接 一定是get方式提交 # print(resp) # print(resp.text) # 拿到网页源代码 访问被拦截 # import requests # url = "http://www.sogou.c原创 2021-04-19 18:18:10 · 239 阅读 · 0 评论 -
爬虫2-web请求与http协议
1web请求 1服务器渲染 在服务器那边直接把数据和html整合在一起,统一返回给浏览器 在页面源代码中可以看到数据 2客户端渲染 第一次请求只拿到html骨架, 第二次请求拿到数据,进行数据分析 在页面源代码中看不到数据 熟练使用浏览器抓包工具:检查(F12)-network-header,preview 2http协议 协议:数据间传输的规则 HTTP协议:超文本传输协议,用于从www 服务器传输超文本到本地浏览...原创 2021-04-19 17:59:30 · 106 阅读 · 0 评论 -
爬虫1-爬虫入门
爬虫 通过编写程序来获取到互联网上的资源 需求:用程序模拟浏览器 输入一个网址 从该网址中获取到资源或者内容 """ File: 01入门.py Author: chde_wang Date: 2021-04-19 14:30:31 Description: """ # 爬虫 通过编写程序来获取到互联网上的资源 # 百度 # 需求:用程序模拟浏览器 输入一个网址 从该网址中获取到资源或者内容 from urllib.request import urlopen url = "http://www....原创 2021-04-19 17:56:37 · 129 阅读 · 0 评论