- 博客(3)
- 资源 (2)
- 收藏
- 关注
原创 Python SyntaxError: unexpected EOF while parsing
代码: import url_get from bs4 import BeautifulSoup import re def news_select(url,fold_name,*selectors): html = url_get.get_html(url) #获取html soup = BeautifulSoup(html,'html.parser') #定义一...
2018-10-01 09:35:09
2671
原创 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
11144
4
原创 Python爬虫遇到的问题(一)---关于utf-8,gbk
Python爬虫遇到的问题(一)—关于utf-8,gbk 遇到的问题 最初,在爬取浙江工商大学信息网时,使用了以下代码: from bs4 import BeautifulSoup import urllib.request def get_html(url): page = urllib.request.urlopen(url) htmlcode = page.read() ...
2018-09-27 19:31:20
3613
2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人