- 博客(3)
- 资源 (2)
- 收藏
- 关注
原创 Python SyntaxError: unexpected EOF while parsing
代码:import url_getfrom bs4 import BeautifulSoupimport redef news_select(url,fold_name,*selectors): html = url_get.get_html(url) #获取html soup = BeautifulSoup(html,'html.parser') #定义一...
2018-10-01 09:35:09
2616
原创 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
原创 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
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人