![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
Martin_Yelvin
平时分享记录自己的遇到的问题,评论区莫名其妙被一些零文章零贡献的批骂。 现在只是偶尔记录了,现在这行业门槛太低了,终于知道为什么很多大神付费分享了,确实能过滤一堆人渣
展开
-
Python_输入raw_input就会出错?
Python 3 中没有raw_input,可以使用 inputmyResponse = requests.get(url,auth=(input("username: "),input("api_key: ")))具体区别转:https://blog.csdn.net/ichuzhen/article/details/53608021原创 2018-04-23 15:19:16 · 5911 阅读 · 0 评论 -
Python_使用selenium webdriver 启动报错:Traceback (most recent call last):
Python_使用selenium webdriver 启动报错:Traceback (most recent call last):Traceback (most recent call last): File "get500px.py", line 10, in <module> driver = webdriver.Chrome() File "C:\Users\...原创 2018-04-27 17:02:27 · 44185 阅读 · 14 评论 -
Python_python爬虫实例项目大全
WechatSogou [1]- 微信公众号爬虫。基于搜狗微信搜索的微信公众号爬虫接口,可以扩展成基于搜狗搜索的爬虫,返回结果是列表,每一项均是公众号具体信息字典。DouBanSpider [2]- 豆瓣读书爬虫。可以爬下豆瓣读书标签下的所有图书,按评分排名依次存储,存储到Excel中,可方便大家筛选搜罗,比如筛选评价人数>1000的高分书籍;可依据不同的主题存储到Excel不同的Sheet...转载 2018-04-20 18:33:54 · 283 阅读 · 0 评论 -
Python3_Beautiful Soup 4.4.0 文档
Beautiful Soup 4.4.0 文档地址:点击打开链接原创 2018-04-20 16:54:31 · 262 阅读 · 0 评论 -
Python3_爬万年历
import urllib.requestfrom bs4 import BeautifulSoupfrom colorama import init,Fore # init是初始化,Fore是字体颜色init(autoreset=True) # 初始化root_url = 'https://wannianrili.51240.com/'response = urllib.reque...原创 2018-04-20 16:49:56 · 1482 阅读 · 0 评论 -
Python_获取网站的编码格式
# -*- coding: UTF-8 -*-from urllib import requestimport chardetif __name__ == "__main__": response = request.urlopen("http://www.baidu.com/") html = response.read() charset = chardet.detect(h...原创 2018-04-20 15:30:22 · 267 阅读 · 0 评论 -
Python_from urllib import request 报错,找不到request
1. 没安装urllib pip install urllib2.可能你的文件名是。。。urllib.py 改名原创 2018-04-20 15:25:02 · 12743 阅读 · 8 评论 -
ImportError: cannot import name 'request'
requests是Python的一个HTTP客户端库,跟urllib,urllib2类似,安装即可下载包:点击打开链接原创 2018-04-20 15:09:26 · 12582 阅读 · 4 评论 -
Python_去掉html的空格和 
用replace(' ','')替换掉。get_text(strip=True)只能去掉字符串前后的空行原创 2018-04-19 17:18:59 · 10665 阅读 · 0 评论 -
Beautifulsoup使用 find_all()获取网页标签中提取子元素
tag_soup = soup.find(class_='base-list switch_part')meanings = tag_soup.find_all(class_='clearfix')for i in range(len(meanings)): print(Fore.YELLOW + partSpeech + meanings[i].find('spa...原创 2018-04-19 17:02:54 · 13311 阅读 · 1 评论 -
Python_查看sqlite3表结构,查询语句
#!/usr/bin/env python3# -*- coding: utf-8 -*-import sqlite3conn = sqlite3.connect('test.db')# 创建一个Cursor:cursor = conn.cursor()# 查询记录:conn = sqlite3.connect('calendar.db')cursor = conn.cur...原创 2018-07-19 15:40:52 · 7125 阅读 · 0 评论