![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python爬虫
文章平均质量分 56
FCinPJ
这个作者很懒,什么都没留下…
展开
-
Python爬虫遇到的问题(一)---关于utf-8,gbk
Python爬虫遇到的问题(一)—关于utf-8,gbk遇到的问题最初,在爬取浙江工商大学信息网时,使用了以下代码:from bs4 import BeautifulSoupimport urllib.requestdef get_html(url): page = urllib.request.urlopen(url) htmlcode = page.read() ...原创 2018-09-27 19:31:20 · 3551 阅读 · 2 评论 -
Python爬虫遇到的问题(二)---关于beautifulsoup select方法时得到空列表的问题
问题右键点击审查,然后在弹出的html源码中右键选择Copy–>Copy selector得到#topic > dl:nth-child(3) > div > div.newsbottom > ul > li:nth-child(8) > a描述了我们想要获取的内容在html中的由外层到内层的位置/路径信息。from bs4 import Be...原创 2018-09-27 19:55:55 · 10916 阅读 · 4 评论