![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
eagle1024
25404210@qq.com
展开
-
wxpython学习笔记(一)
环境:操作系统:win7 SP1python:2.7.11wxpython:3.0.2.0学习第一天,先搞个Hello world先附上源码再解释:#!/usr/bin/pythonimport wxclass MyApp(wx.App):def OnInit(self):wx.MessageBox("Hello world,wxpthon","wx原创 2016-05-25 20:46:29 · 567 阅读 · 0 评论 -
解决python3写文件时无法处理中文字符的问题
问题描述:我用selenium访问了百度云,并获取了html内容,想把它保存到本地文件但总是报如下错误:---------------------------------------------------------------------------UnicodeEncodeError Traceback (most recent c原创 2017-09-10 12:23:30 · 6448 阅读 · 1 评论 -
大家一起学爬虫(二)
1。查找同级子节点from urllib.request import urlopenfrom bs4 import BeautifulSouphtml = urlopen("http://www.pythonscraping.com/pages/page3.html")bsObj = BeautifulSoup(html,"lxml")# 查找同级子节点for sibling i原创 2017-09-20 21:23:53 · 400 阅读 · 0 评论 -
python3解决爬取网页中文显示为16进制数的问题
最近发现一个问题,网页爬取出来的中文显示为十六进制。代码如下:import urllib.request as rstimport reimport requestsresponse = rst.urlopen('http://hq.sinajs.cn/list=s_sz000001')print("dest text=", stockStr)结果如下:dest text= b'var h...原创 2018-07-13 18:31:23 · 6639 阅读 · 1 评论