上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页
摘要: 爬取淘宝笔记本电脑数据 1.导入模块 from selenium import webdriver import time import csv import re 2.搜索商品,获取商品页码 def search_product(key_word): # 定位输入框 browser.find_el 阅读全文
posted @ 2020-10-10 12:54 秋弦 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 哔哩哔哩自动播放视频 # datetime:2020/10/7 16:33 # bilibili from selenium import webdriver from selenium.webdriver.common.keys import Keys import time #打开浏览器,实例化 阅读全文
posted @ 2020-10-07 16:39 秋弦 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 51job多线程爬取指定职业信息数据 # datetime:2020/10/7 14:02 # 51job多线程 import requests import chardet from bs4 import BeautifulSoup import csv from openpyxl import 阅读全文
posted @ 2020-10-07 16:22 秋弦 阅读(285) 评论(1) 推荐(0) 编辑
摘要: 爬取王者荣耀角色信息 01 编写配置文件(通用) import requests import bs4 import chardet import random import csv import time from bs4 import BeautifulSoup import os def ge 阅读全文
posted @ 2020-10-07 09:08 秋弦 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 爬取网易云音乐评论保存CSV selenium的使用 01 导入模块 from selenium import webdriver 02 打开浏览器 实例化对象 driver = webdriver.Chrome() 03 访问网址 driver.get('https://www.baidu.com 阅读全文
posted @ 2020-10-07 08:58 秋弦 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 抓取简书文章标题链接 文章链接:https://www.jianshu.com/p/85f4624485b9 01 详细版本 # datetime:2020/10/6 13:53 # 抓取简书文章标题链接 import pandas as pd from requests_html import H 阅读全文
posted @ 2020-10-06 17:44 秋弦 阅读(284) 评论(0) 推荐(0) 编辑
摘要: Python错误集锦 01 未定义 # 1.未定义 print(a) 02 类型不一致 # 2. 类型不一致 b = 'haha' c = 123 b+c b+str(c) 'haha123' c+b c+int(b) int('8') 8 03 语法错误 # 3.语法错误 # 符写错了 print 阅读全文
posted @ 2020-10-05 18:27 秋弦 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 51Job多页信息爬取 01 导入模块 import requests import chardet from bs4 import BeautifulSoup import csv from openpyxl import Workbook 02 定义函数getOnePageInfo() def 阅读全文
posted @ 2020-10-05 18:12 秋弦 阅读(345) 评论(1) 推荐(0) 编辑
摘要: 案例: 01壁纸链接爬取并保存csv #导入模块 import requests import chardet from bs4 import BeautifulSoup #访问链接 url = 'http://www.netbian.com/dongman/' #打开链接,得到响应 res = r 阅读全文
posted @ 2020-10-05 18:00 秋弦 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Jupyter使用 一、创键 01 创键一个本地文件夹 02 输入cmd 回车 03 弹出cmd窗口,输入命令jupyter notebook回车 04 执行成功,弹出浏览器 阅读全文
posted @ 2020-10-05 17:52 秋弦 阅读(244) 评论(0) 推荐(0) 编辑
摘要: Python爬虫 01百度 # 导入模块 from urllib import request # 2. 准备网址 url = 'http://www.baidu.com/' # 3. 打开链接,得到响应 res = request.urlopen(url) # 4. 展现(print)响应结果 p 阅读全文
posted @ 2020-10-05 17:37 秋弦 阅读(365) 评论(0) 推荐(0) 编辑
摘要: 一、码云部署个人静态网站 1.创建仓库 2.设置仓库基本信息 3.提示创建完成 4.在需要上传的网页目录下右键,选择Git Bash Here 5.初始化仓库 输入git init 回车 6.把本地文件放入暂存区 git add . 7.把暂存区文件放入仓库 git commit -m "first 阅读全文
posted @ 2020-09-26 20:27 秋弦 阅读(831) 评论(0) 推荐(0) 编辑
摘要: Python访问数据库 本文案例基于runoob数据库下,51job表演示 1.MySQL的连接 import pymysql # 打开数据库连接 db = pymysql.connect("localhost", "root", "123456", "runoob") # 使用 cursor() 阅读全文
posted @ 2020-09-17 21:36 秋弦 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 文件读写Excel 1.使用xlrd读取excel #使用xlrd读取excel #1.导入模块 import xlrd # 2. 使用xlrd的函数打开本地文件 workbook=xlrd.open_workbook('案例.xlsx') #3. 获取工作表 # sheets=workbook.s 阅读全文
posted @ 2020-09-17 21:35 秋弦 阅读(804) 评论(0) 推荐(0) 编辑
摘要: 一、文件的基本操作 2.1 文件操作步骤 打开文件 读写等操作 关闭文件 注意:可以只打开和关闭文件,不进行任何读写操作 2.1.1 打开 在python,使⽤用open函数,可以打开⼀一个已经存在的文件,或者创建一个新⽂文件,语法如下: open(name, mode) name:是要打开的目标文 阅读全文
posted @ 2020-09-15 19:23 秋弦 阅读(1088) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页