![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
食鱼酱
一只努力向上的程序员
展开
-
Python在写入文件时中文报错IOError: [Errno 22] invalid mode ('w') or filename
Python版本为2.7.0,IDE为PyCharmf = open(filename, 'w')f.write(html)filename中包含中文,html为一个网页数据,结果报了如下的错 File "D:/PythonWorkSpace/test.py", line 42, in tiebaSpider(fullUrl,beginPage,endPage)原创 2018-01-31 10:40:34 · 12242 阅读 · 2 评论 -
BeautifulSoup4在Windows下的安装
本文所用的IDE为PyCharm社区版,Python版本为2.7.0BeautifulSoup4的安装 1)File->Setting… 2)在左侧菜单中找到Project Interceptorm,之后点击偏右上方的绿色“+” 3)在弹出的页面搜索BeautifulSoup4,安装 BeautifulSoup4的使用 来个小Demofrom bs4 import B原创 2018-02-01 15:42:07 · 952 阅读 · 0 评论 -
BeautifulSoup4出现警告:To get rid of this warning, change code that looks like this:BeautifulSoup(YOUR_M
使用BeautifulSoup4出现警告: To get rid of this warning, change code that looks like this:BeautifulSoup(YOUR_MARKUP})将soup = BeautifulSoup(html)改成soup = BeautifulSoup(html,”lxml”)后就不会再出现警告原创 2018-02-01 15:58:51 · 1264 阅读 · 0 评论