|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- from urllib import request
- import urllib
- import re
- from jieba import analyse
- search=urllib.parse.quote('哲♂学')
- f=open('1.txt','a')
- for i in range(10):
-
- print('正在读取第'+str(i+1)+'页数据...')
- response=request.urlopen('https://s.taobao.com/search?q='+search+'&s='+str(i*44)).read().decode('utf-8')
- title=re.findall(r'"raw_title":"([^"]+)"',response)
-
- for each in title:
-
-
- f.write(each+'\n')
- f.close()
- content=open('1.txt','rb').read()
- tags = analyse.extract_tags(content, topK=100, withWeight=False)
- print(tags)
- text =" ".join(tags)
复制代码
|
评分
-
查看全部评分
|