- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfileoperation.py
More file actions
Latest commit
27 lines (20 loc) · 743 Bytes
/
Copy pathfileoperation.py
File metadata and controls
27 lines (20 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*-coding:utf-8-*-
importurllib
fromurllibimportrequest
fromjsonimportloads
importre
defgetUrlList():
html=urllib.request.urlopen(r'https://mm.taobao.com/tstar/search/tstar_model.do?_input_charset=utf-8')
response=html.read();
page=response.decode('GBK');
# print(page)
# print(type(page))
# print(loads(page))
returnloads(page)['data']['searchDOList']
# response = request.urlopen(r'https://mm.taobao.com/tstar/search/tstar_model.do?_input_charset=utf-8') # <http.client.HTTPResponse object at 0x00000000048BC908> HTTPResponse类型
# page = response.read()
# page = page.decode('GBK')
# print(page)
# print(type(getUrlList()))
foriingetUrlList():
print(i["realName"])