zxy0307 commited on
Commit
048498a
·
verified ·
1 Parent(s): f8f16a2

Upload 173 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. 01_爬虫基础与数据提取.ipynb +0 -0
  2. 02_高级爬虫与Selenium.ipynb +2766 -0
  3. 03_Scrapy框架.ipynb +0 -0
  4. 04_MongoDB数据库.ipynb +1009 -0
  5. data/.DS_Store +0 -0
  6. data/chaojiying_Python/__pycache__/chaojiying.cpython-39.pyc +0 -0
  7. data/chaojiying_Python/a.jpg +0 -0
  8. data/chaojiying_Python/chaojiying.py +54 -0
  9. data/chaojiying_Python/untitled.png +0 -0
  10. data/city.json +1 -0
  11. data/dictStr.json +1 -0
  12. data/listStr.json +1 -0
  13. data/movie.txt +0 -0
  14. data/python/347/210/254/350/231/253.png +0 -0
  15. data/tmp.png +16 -0
  16. gaode.html +296 -0
  17. html/.DS_Store +0 -0
  18. html/alter.html +17 -0
  19. html/drop_down.html +14 -0
  20. html/frame.html +21 -0
  21. html/hello.html +9 -0
  22. html/inner.html +15 -0
  23. html/level_locate.html +41 -0
  24. html/scroll.html +38 -0
  25. html/test01.html +39 -0
  26. html/猫眼电影.html +222 -0
  27. scrap.py +22 -0
  28. scrapy/.DS_Store +0 -0
  29. scrapy/__init__.py +0 -0
  30. scrapy/__pycache__/__init__.cpython-39.pyc +0 -0
  31. scrapy/gaode/gaode.html +296 -0
  32. scrapy/gaode/gaode/__init__.py +0 -0
  33. scrapy/gaode/gaode/__pycache__/__init__.cpython-311.pyc +0 -0
  34. scrapy/gaode/gaode/__pycache__/middlewares.cpython-311.pyc +0 -0
  35. scrapy/gaode/gaode/__pycache__/settings.cpython-311.pyc +0 -0
  36. scrapy/gaode/gaode/items.py +12 -0
  37. scrapy/gaode/gaode/middlewares.py +117 -0
  38. scrapy/gaode/gaode/pipelines.py +13 -0
  39. scrapy/gaode/gaode/settings.py +116 -0
  40. scrapy/gaode/gaode/spiders/__init__.py +4 -0
  41. scrapy/gaode/gaode/spiders/__pycache__/__init__.cpython-311.pyc +0 -0
  42. scrapy/gaode/gaode/spiders/__pycache__/bit.cpython-311.pyc +0 -0
  43. scrapy/gaode/gaode/spiders/bit.py +11 -0
  44. scrapy/gaode/scrapy.cfg +11 -0
  45. scrapy/scrapy01/data/game.txt +207 -0
  46. scrapy/scrapy01/scrapy.cfg +11 -0
  47. scrapy/scrapy01/scrapy01/__init__.py +0 -0
  48. scrapy/scrapy01/scrapy01/__pycache__/__init__.cpython-39.pyc +0 -0
  49. scrapy/scrapy01/scrapy01/__pycache__/items.cpython-39.pyc +0 -0
  50. scrapy/scrapy01/scrapy01/__pycache__/pipelines.cpython-39.pyc +0 -0
01_爬虫基础与数据提取.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
02_高级爬虫与Selenium.ipynb ADDED
@@ -0,0 +1,2766 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "23777228",
6
+ "metadata": {},
7
+ "source": [
8
+ "## 多线程爬虫"
9
+ ]
10
+ },
11
+ {
12
+ "cell_type": "markdown",
13
+ "id": "975b85f2",
14
+ "metadata": {},
15
+ "source": [
16
+ "我们之前写的爬虫都是单个线程的,一旦一个地方卡住不动了,那不就永远等待下去了?为此我们可以使用多线程或者多进程来处理"
17
+ ]
18
+ },
19
+ {
20
+ "cell_type": "markdown",
21
+ "id": "f781ac03",
22
+ "metadata": {},
23
+ "source": [
24
+ "爬虫使用多线程来处理网络请求,使用线程来处理URL队列中的url,然后将url返回的结果保存在另一个队列中,其它线程在读取这个队列中的数据,然后写到文件中去"
25
+ ]
26
+ },
27
+ {
28
+ "cell_type": "markdown",
29
+ "id": "afac729b",
30
+ "metadata": {},
31
+ "source": [
32
+ "### URL队列和结果队列\n",
33
+ "将要爬取的 url 放在一个队列中,这里使用标准库Queue。访问url后的结果保存在结果队列中\n",
34
+ "\n",
35
+ "初始化一个URL队列:"
36
+ ]
37
+ },
38
+ {
39
+ "cell_type": "code",
40
+ "execution_count": 1,
41
+ "id": "6bab93d1",
42
+ "metadata": {
43
+ "ExecuteTime": {
44
+ "end_time": "2023-10-25T01:53:02.653170Z",
45
+ "start_time": "2023-10-25T01:53:02.642540Z"
46
+ }
47
+ },
48
+ "outputs": [],
49
+ "source": [
50
+ "from queue import Queue\n",
51
+ "\n",
52
+ "urls_queue = Queue()\n",
53
+ "out_queue = Queue()"
54
+ ]
55
+ },
56
+ {
57
+ "cell_type": "markdown",
58
+ "id": "c27cb7c0",
59
+ "metadata": {},
60
+ "source": [
61
+ "**Queue模块中的常用方法:**\n",
62
+ "\n",
63
+ "Python的 Queue模块 中提供了同步的、线程安全的队列类,包括FIFO(先入先出)队列Queue,LIFO(后入先出)队列LifoQueue,和优先级队列PriorityQueue。这些队列都实现了锁原语,能够在多线程中直接使用。可以使用队列来实现线程间的同步\n",
64
+ "\n",
65
+ "- Queue.qsize() \n",
66
+ " - 返回队列的大小\n",
67
+ "- Queue.empty() \n",
68
+ " - 如果队列为空,返回True, 反之False\n",
69
+ "- Queue.full() \n",
70
+ " - 如果队列满了,返回True, 反之False\n",
71
+ "- Queue.full \n",
72
+ " - 与 maxsize 大小对应\n",
73
+ "- Queue.get([block[, timeout]]) \n",
74
+ " - 获取队列,timeout等待时间\n",
75
+ "- Queue.get_nowait() \n",
76
+ " - 相当 Queue.get(False)\n",
77
+ "- Queue.put(item) \n",
78
+ " - 写入队列,timeout等待时间\n",
79
+ "- Queue.put_nowait(item) \n",
80
+ " - 相当Queue.put(item, False)\n",
81
+ "- Queue.task_done() \n",
82
+ " - 在完成一项工作之后,Queue.task_done()函数向任务已经完成的队列发送一个信号\n",
83
+ "- Queue.join() \n",
84
+ " - 实际上意味着等到队列为空,再执行别的操作"
85
+ ]
86
+ },
87
+ {
88
+ "cell_type": "markdown",
89
+ "id": "8837d97b",
90
+ "metadata": {},
91
+ "source": [
92
+ "### 类包装\n",
93
+ "\n",
94
+ "使用多个线程,不停的取URL队列中的url,并进行处理:"
95
+ ]
96
+ },
97
+ {
98
+ "cell_type": "code",
99
+ "execution_count": 2,
100
+ "id": "9aae0358",
101
+ "metadata": {
102
+ "ExecuteTime": {
103
+ "end_time": "2023-10-25T02:01:15.814084Z",
104
+ "start_time": "2023-10-25T02:01:15.805802Z"
105
+ }
106
+ },
107
+ "outputs": [],
108
+ "source": [
109
+ "import threading\n",
110
+ "\n",
111
+ "class ThreadCrawl(threading.Thread):\n",
112
+ " \"\"\"爬取数据的线程\"\"\"\n",
113
+ " \n",
114
+ " def __init__(self, queue, out_queue):\n",
115
+ " \n",
116
+ " # 线程初始化\n",
117
+ " threading.Thread.__init__(self)\n",
118
+ " \n",
119
+ " # URL队列\n",
120
+ " self.queue = queue\n",
121
+ " self.out_queue = out_queue\n",
122
+ "\n",
123
+ " def run(self):\n",
124
+ " \n",
125
+ " # 取出 URL队列\n",
126
+ " while True:\n",
127
+ " item = self.queue.get()"
128
+ ]
129
+ },
130
+ {
131
+ "cell_type": "markdown",
132
+ "id": "b82f3c50",
133
+ "metadata": {},
134
+ "source": [
135
+ "如果队列为空,线程就会被阻塞,直到队列不为空。处理队列中的一条数据后,就需要通知队列已经处理完该条数据"
136
+ ]
137
+ },
138
+ {
139
+ "cell_type": "code",
140
+ "execution_count": 10,
141
+ "id": "f1b10c9f",
142
+ "metadata": {
143
+ "ExecuteTime": {
144
+ "end_time": "2023-10-26T00:13:21.193924Z",
145
+ "start_time": "2023-10-26T00:13:21.181692Z"
146
+ }
147
+ },
148
+ "outputs": [
149
+ {
150
+ "name": "stdout",
151
+ "output_type": "stream",
152
+ "text": [
153
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=1&pageSize=50\n",
154
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=3&pageSize=50\n",
155
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=2&pageSize=50\n",
156
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=4&pageSize=50\n",
157
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=6&pageSize=50\n",
158
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=5&pageSize=50\n",
159
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=7&pageSize=50\n",
160
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=8&pageSize=50\n",
161
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=9&pageSize=50\n",
162
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=10&pageSize=50\n"
163
+ ]
164
+ }
165
+ ],
166
+ "source": [
167
+ "from threading import Thread\n",
168
+ "from fake_useragent import UserAgent\n",
169
+ "import requests\n",
170
+ "from time import sleep\n",
171
+ "from queue import Queue\n",
172
+ "\n",
173
+ "\n",
174
+ "class MyThread(Thread):\n",
175
+ " def __init__(self):\n",
176
+ " Thread.__init__(self)\n",
177
+ "\n",
178
+ " def run(self):\n",
179
+ " \"\"\"线程执行的函数\"\"\"\n",
180
+ " \n",
181
+ " # 如果队列不为空\n",
182
+ " while not url_queue.empty():\n",
183
+ " \n",
184
+ " # 获取 URL地址\n",
185
+ " url = url_queue.get()\n",
186
+ " \n",
187
+ " # 随机生成用户代理\n",
188
+ " headers = {'User-Agent': UserAgent().chrome}\n",
189
+ " \n",
190
+ " # 发送 GET请求\n",
191
+ " resp = requests.get(url, headers=headers)\n",
192
+ " \n",
193
+ " sleep(3)\n",
194
+ " \n",
195
+ " if resp.status_code == 200:\n",
196
+ " print(f'成功获取{url}')\n",
197
+ "\n",
198
+ "\n",
199
+ "if __name__ == '__main__':\n",
200
+ " \n",
201
+ " # 创建队列\n",
202
+ " url_queue = Queue()\n",
203
+ " \n",
204
+ " # 为队列添加 URL地址\n",
205
+ " for i in range(1, 11):\n",
206
+ " url = f'https://www.hupu.com/home/v1/news?pageNo={i}&pageSize=50'\n",
207
+ " url_queue.put(url)\n",
208
+ "\n",
209
+ " # 启动线程\n",
210
+ " for i in range(3):\n",
211
+ " t1 = MyThread()\n",
212
+ " t1.start()"
213
+ ]
214
+ },
215
+ {
216
+ "cell_type": "markdown",
217
+ "id": "1850d462",
218
+ "metadata": {},
219
+ "source": [
220
+ "### 函数包装"
221
+ ]
222
+ },
223
+ {
224
+ "cell_type": "code",
225
+ "execution_count": 3,
226
+ "id": "34ed2d82",
227
+ "metadata": {
228
+ "ExecuteTime": {
229
+ "end_time": "2023-10-25T02:01:19.768946Z",
230
+ "start_time": "2023-10-25T02:01:19.765356Z"
231
+ }
232
+ },
233
+ "outputs": [],
234
+ "source": [
235
+ "from threading import Thread\n",
236
+ "\n",
237
+ "def func(args):\n",
238
+ " pass\n",
239
+ "\n",
240
+ "\n",
241
+ "if __name__ == '__main__':\n",
242
+ " \n",
243
+ " # URL队列\n",
244
+ " info_html = Queue()\n",
245
+ " \n",
246
+ " # 创建线程\n",
247
+ " t1 = Thread(target=func, # 线程要执行的函数\n",
248
+ " args=(info_html,)) # 传入参数"
249
+ ]
250
+ },
251
+ {
252
+ "cell_type": "code",
253
+ "execution_count": 9,
254
+ "id": "442178d0",
255
+ "metadata": {
256
+ "ExecuteTime": {
257
+ "end_time": "2023-10-26T00:10:08.271999Z",
258
+ "start_time": "2023-10-26T00:10:08.259663Z"
259
+ }
260
+ },
261
+ "outputs": [
262
+ {
263
+ "name": "stdout",
264
+ "output_type": "stream",
265
+ "text": [
266
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=1&pageSize=50\n",
267
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=2&pageSize=50\n",
268
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=3&pageSize=50\n",
269
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=5&pageSize=50\n",
270
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=4&pageSize=50\n",
271
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=6&pageSize=50\n",
272
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=7&pageSize=50\n",
273
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=9&pageSize=50\n",
274
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=8&pageSize=50\n",
275
+ "成功获取https://www.hupu.com/home/v1/news?pageNo=10&pageSize=50\n"
276
+ ]
277
+ }
278
+ ],
279
+ "source": [
280
+ "from threading import Thread\n",
281
+ "from fake_useragent import UserAgent\n",
282
+ "import requests\n",
283
+ "from time import sleep\n",
284
+ "from queue import Queue\n",
285
+ "\n",
286
+ "\n",
287
+ "def spider():\n",
288
+ "\n",
289
+ " # 如果 URL队列不为空\n",
290
+ " while not url_queue.empty():\n",
291
+ "\n",
292
+ " # 获取 URL地址\n",
293
+ " url = url_queue.get()\n",
294
+ " \n",
295
+ " # 随机生成 用户代理\n",
296
+ " headers = {'User-Agent': UserAgent().chrome}\n",
297
+ " \n",
298
+ " # 发送 GET请求\n",
299
+ " resp = requests.get(url, headers=headers)\n",
300
+ " \n",
301
+ " sleep(3)\n",
302
+ " \n",
303
+ " # 如果获取成功,则打印\n",
304
+ " if resp.status_code == 200:\n",
305
+ " print(f'成功获取{url}')\n",
306
+ "\n",
307
+ "\n",
308
+ "if __name__ == '__main__':\n",
309
+ " \n",
310
+ " # 创建队列\n",
311
+ " url_queue = Queue()\n",
312
+ " \n",
313
+ " # 添加 URL地址\n",
314
+ " for i in range(1, 11):\n",
315
+ " url = f'https://www.hupu.com/home/v1/news?pageNo={i}&pageSize=50'\n",
316
+ " url_queue.put(url)\n",
317
+ "\n",
318
+ " # 启动 3个线程\n",
319
+ " for i in range(3):\n",
320
+ " t1 = Thread(target=spider)\n",
321
+ " t1.start()"
322
+ ]
323
+ },
324
+ {
325
+ "cell_type": "markdown",
326
+ "id": "e3e28449",
327
+ "metadata": {},
328
+ "source": [
329
+ "### 线程池"
330
+ ]
331
+ },
332
+ {
333
+ "cell_type": "code",
334
+ "execution_count": 4,
335
+ "id": "d239aafe",
336
+ "metadata": {
337
+ "ExecuteTime": {
338
+ "end_time": "2023-10-25T09:35:58.043706Z",
339
+ "start_time": "2023-10-25T09:35:57.016973Z"
340
+ }
341
+ },
342
+ "outputs": [
343
+ {
344
+ "name": "stdout",
345
+ "output_type": "stream",
346
+ "text": [
347
+ "0678314259\n",
348
+ "\n",
349
+ "\n",
350
+ "\n",
351
+ "\n",
352
+ "\n",
353
+ "\n",
354
+ "\n",
355
+ "\n",
356
+ "\n",
357
+ "101112131415171819\n",
358
+ "\n",
359
+ "\n",
360
+ "\n",
361
+ "16\n",
362
+ "\n",
363
+ "\n",
364
+ "\n",
365
+ "\n",
366
+ "\n"
367
+ ]
368
+ }
369
+ ],
370
+ "source": [
371
+ "# 简单往队列中传输线程数\n",
372
+ "import threading\n",
373
+ "import time\n",
374
+ "import queue\n",
375
+ "\n",
376
+ "\n",
377
+ "class Threadingpool():\n",
378
+ " \"\"\"线程池类\"\"\"\n",
379
+ " \n",
380
+ " def __init__(self, max_num=10):\n",
381
+ " \n",
382
+ " # 创建一个容量为10 的队列\n",
383
+ " self.queue = queue.Queue(max_num)\n",
384
+ " \n",
385
+ " # 为队列添加 10个线程\n",
386
+ " for i in range(max_num):\n",
387
+ " self.queue.put(threading.Thread)\n",
388
+ "\n",
389
+ " def getthreading(self):\n",
390
+ " \"\"\"取线程\"\"\"\n",
391
+ " return self.queue.get()\n",
392
+ "\n",
393
+ " def addthreading(self):\n",
394
+ " \"\"\"添加线程\"\"\"\n",
395
+ " self.queue.put(threading.Thread)\n",
396
+ "\n",
397
+ "\n",
398
+ "def func(p, i):\n",
399
+ " \"\"\"线程执行的函数:传入线程池、\"\"\"\n",
400
+ " time.sleep(1)\n",
401
+ " print(i)\n",
402
+ " p.addthreading()\n",
403
+ "\n",
404
+ "\n",
405
+ "if __name__ == \"__main__\":\n",
406
+ " \n",
407
+ " # 创建线程池\n",
408
+ " p = Threadingpool()\n",
409
+ " \n",
410
+ " for i in range(20):\n",
411
+ " # 取线程\n",
412
+ " thread = p.getthreading()\n",
413
+ " \n",
414
+ " # 配置线程\n",
415
+ " t = thread(target=func, # 要执行的函数\n",
416
+ " args=(p, i)) # 要传递的参数\n",
417
+ " \n",
418
+ " # 开启线程\n",
419
+ " t.start()"
420
+ ]
421
+ },
422
+ {
423
+ "cell_type": "markdown",
424
+ "id": "4d74944d",
425
+ "metadata": {},
426
+ "source": [
427
+ "## 多进程爬虫\n",
428
+ "multiprocessing 是python的多进程管理包,和 threading.Thread 类似\n",
429
+ "\n",
430
+ "### multiprocessing模块\n",
431
+ "\n",
432
+ "在multiprocessing中,通过创建Process对象生成进程,然后调用它的 start() 方法"
433
+ ]
434
+ },
435
+ {
436
+ "cell_type": "code",
437
+ "execution_count": 8,
438
+ "id": "e2299a62",
439
+ "metadata": {
440
+ "ExecuteTime": {
441
+ "end_time": "2023-10-25T09:48:59.303621Z",
442
+ "start_time": "2023-10-25T09:48:59.219784Z"
443
+ }
444
+ },
445
+ "outputs": [
446
+ {
447
+ "name": "stderr",
448
+ "output_type": "stream",
449
+ "text": [
450
+ "Traceback (most recent call last):\n",
451
+ " File \"<string>\", line 1, in <module>\n",
452
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/spawn.py\", line 116, in spawn_main\n",
453
+ " exitcode = _main(fd, parent_sentinel)\n",
454
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/spawn.py\", line 126, in _main\n",
455
+ " self = reduction.pickle.load(from_parent)\n",
456
+ "AttributeError: Can't get attribute 'func1' on <module '__main__' (built-in)>\n"
457
+ ]
458
+ }
459
+ ],
460
+ "source": [
461
+ "\"\"\"jupyter notebook中,下列代码无法被正常执行,请在Pycharm中尝试\"\"\"\n",
462
+ "\n",
463
+ "from multiprocessing import Process\n",
464
+ "\n",
465
+ "def func1(name):\n",
466
+ " \"\"\"进程执行的函数\"\"\"\n",
467
+ " print('hello', name)\n",
468
+ "\n",
469
+ "\n",
470
+ "if __name__ == \"__main__\":\n",
471
+ " \n",
472
+ " # 创建进程\n",
473
+ " p = Process(target=func1,args=('BIT',))\n",
474
+ " \n",
475
+ " # 开启进程\n",
476
+ " p.start()\n",
477
+ " \n",
478
+ " # 等待进程执行完毕\n",
479
+ " p.join()"
480
+ ]
481
+ },
482
+ {
483
+ "cell_type": "markdown",
484
+ "id": "36654bc1",
485
+ "metadata": {},
486
+ "source": [
487
+ "### Manager类\n",
488
+ "\n",
489
+ "在使用并发设计的时候最好 避免共享数据,尤其是在使用多进程的时候。 \n",
490
+ "\n",
491
+ "如果你真有需要 要共享数据,可以使用由 Manager() 返回的manager提供list, dict, Namespace, Lock, RLock, Semaphore, BoundedSemaphore, Condition, Event, Barrier, Queue, Value and Array类型的支持"
492
+ ]
493
+ },
494
+ {
495
+ "cell_type": "code",
496
+ "execution_count": 9,
497
+ "id": "8bc5cbc0",
498
+ "metadata": {
499
+ "ExecuteTime": {
500
+ "end_time": "2023-10-25T10:05:42.660155Z",
501
+ "start_time": "2023-10-25T10:05:42.496264Z"
502
+ },
503
+ "collapsed": true
504
+ },
505
+ "outputs": [
506
+ {
507
+ "name": "stderr",
508
+ "output_type": "stream",
509
+ "text": [
510
+ "Traceback (most recent call last):\n",
511
+ " File \"<string>\", line 1, in <module>\n",
512
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/spawn.py\", line 116, in spawn_main\n",
513
+ " exitcode = _main(fd, parent_sentinel)\n",
514
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/spawn.py\", line 126, in _main\n",
515
+ " self = reduction.pickle.load(from_parent)\n",
516
+ "AttributeError: Can't get attribute 'put_num' on <module '__main__' (built-in)>\n",
517
+ "Traceback (most recent call last):\n",
518
+ " File \"<string>\", line 1, in <module>\n",
519
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/spawn.py\", line 116, in spawn_main\n",
520
+ " exitcode = _main(fd, parent_sentinel)\n",
521
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/spawn.py\", line 126, in _main\n",
522
+ " self = reduction.pickle.load(from_parent)\n",
523
+ "AttributeError: Can't get attribute 'put_num' on <module '__main__' (built-in)>\n",
524
+ "Traceback (most recent call last):\n",
525
+ " File \"<string>\", line 1, in <module>\n",
526
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/spawn.py\", line 116, in spawn_main\n",
527
+ " exitcode = _main(fd, parent_sentinel)\n",
528
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/spawn.py\", line 126, in _main\n",
529
+ " self = reduction.pickle.load(from_parent)\n",
530
+ "AttributeError: Can't get attribute 'get_num' on <module '__main__' (built-in)>\n"
531
+ ]
532
+ }
533
+ ],
534
+ "source": [
535
+ "\"\"\"jupyter notebook中,下列代码无法被正常执行,请在Pycharm中尝试\"\"\"\n",
536
+ "\n",
537
+ "from multiprocessing import Process, Manager, Lock\n",
538
+ "\n",
539
+ "\n",
540
+ "def put_num(info_queue, l, lo):\n",
541
+ " \"\"\"添加数字\"\"\"\n",
542
+ " \n",
543
+ " # 获得锁\n",
544
+ " with lo:\n",
545
+ " \n",
546
+ " # 向队列添加数字\n",
547
+ " for n in l:\n",
548
+ " info_queue.put(n)\n",
549
+ "\n",
550
+ "\n",
551
+ "def get_num(info_queue, lo):\n",
552
+ " \"\"\"取出数字\"\"\"\n",
553
+ " \n",
554
+ " # 获取锁\n",
555
+ " with lo:\n",
556
+ " \n",
557
+ " # 如果队列不为空,则取出数字\n",
558
+ " while not info_queue.empty():\n",
559
+ " print(info_queue.get())\n",
560
+ "\n",
561
+ "\n",
562
+ "if __name__ == '__main__':\n",
563
+ " \n",
564
+ " # 创建 Manager对象\n",
565
+ " manager = Manager()\n",
566
+ " \n",
567
+ " # 创建 Queue队列\n",
568
+ " into_html = manager.Queue()\n",
569
+ " \n",
570
+ " # 锁对象\n",
571
+ " lock = Lock()\n",
572
+ " a = [1, 2, 3, 4, 5]\n",
573
+ " b = [11, 12, 13, 14, 15]\n",
574
+ "\n",
575
+ " # 开启第一个进程\n",
576
+ " p1 = Process(target=put_num, args=(into_html, a, lock))\n",
577
+ " p1.start()\n",
578
+ " \n",
579
+ " # 开启第二个进程\n",
580
+ " p2 = Process(target=put_num, args=(into_html, b, lock))\n",
581
+ " p2.start()\n",
582
+ " \n",
583
+ " # 开启第三个进程\n",
584
+ " p3 = Process(target=get_num, args=(into_html, lock))\n",
585
+ " p3.start()\n",
586
+ " \n",
587
+ " # 等待 3个进程完成\n",
588
+ " p1.join()\n",
589
+ " p2.join()\n",
590
+ " p3.join()"
591
+ ]
592
+ },
593
+ {
594
+ "cell_type": "code",
595
+ "execution_count": null,
596
+ "id": "2503fdf6",
597
+ "metadata": {},
598
+ "outputs": [],
599
+ "source": [
600
+ "\"\"\"jupyter notebook中,下列代码无法被正常执行,请在Pycharm中尝试\"\"\"\n",
601
+ "from multiprocessing import Process\n",
602
+ "from multiprocessing import Manager\n",
603
+ "import time\n",
604
+ "from fake_useragent import UserAgent\n",
605
+ "import requests\n",
606
+ "from time import sleep\n",
607
+ "\n",
608
+ "\n",
609
+ "def spider(url_queue):\n",
610
+ " \n",
611
+ " # 如果 队列不为空\n",
612
+ " while not url_queue.empty():\n",
613
+ " try:\n",
614
+ " # 获取 URL地址\n",
615
+ " url = url_queue.get(timeout = 1)\n",
616
+ " \n",
617
+ " print(f'成功获取{url}')\n",
618
+ " \n",
619
+ " sleep(1)\n",
620
+ " \n",
621
+ " except Exception as e:\n",
622
+ " print(e)\n",
623
+ "\n",
624
+ "\n",
625
+ "if __name__ == '__main__':\n",
626
+ " \n",
627
+ " # 创建队列\n",
628
+ " url_queue = Manager().Queue()\n",
629
+ " \n",
630
+ " # 添加 URL地址\n",
631
+ " for i in range(1,11):\n",
632
+ " url = f'https://www.hupu.com/home/v1/news?pageNo={i}&pageSize=50'\n",
633
+ " url_queue.put(url)\n",
634
+ " \n",
635
+ " # 存储进程信息\n",
636
+ " all_process = []\n",
637
+ " \n",
638
+ " # 开启进程\n",
639
+ " for i in range(3):\n",
640
+ " p1 = Process(target=spider,args=(url_queue,))\n",
641
+ " p1.start()\n",
642
+ " all_process.append(p1)\n",
643
+ " \n",
644
+ " # 等待所有进程结束,主进程再结束\n",
645
+ " [p.join() for p in all_process] "
646
+ ]
647
+ },
648
+ {
649
+ "cell_type": "markdown",
650
+ "id": "b490eb8d",
651
+ "metadata": {},
652
+ "source": [
653
+ "### 进程池的使用\n",
654
+ "\n",
655
+ "- 进程池内部维护一个进程序列,当使用时,则去进程池中获取一个进程,如果进程池序列中没有可供使用的进程,那么程序就会等待,直到进程池中有可用进程为止。\n",
656
+ "\n",
657
+ "- 进程池中有两个方法:\n",
658
+ " - apply 同步执行 - 串行\n",
659
+ " - apply_async 异步执行 - 并行"
660
+ ]
661
+ },
662
+ {
663
+ "cell_type": "code",
664
+ "execution_count": 2,
665
+ "id": "d9261365",
666
+ "metadata": {
667
+ "ExecuteTime": {
668
+ "end_time": "2023-10-25T10:23:00.150817Z",
669
+ "start_time": "2023-10-25T10:22:47.710399Z"
670
+ },
671
+ "collapsed": true
672
+ },
673
+ "outputs": [
674
+ {
675
+ "name": "stderr",
676
+ "output_type": "stream",
677
+ "text": [
678
+ "Process SpawnPoolWorker-2:\n",
679
+ "Process SpawnPoolWorker-4:\n",
680
+ "Process SpawnPoolWorker-3:\n",
681
+ "Traceback (most recent call last):\n",
682
+ "Traceback (most recent call last):\n",
683
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 315, in _bootstrap\n",
684
+ " self.run()\n",
685
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 108, in run\n",
686
+ " self._target(*self._args, **self._kwargs)\n",
687
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/pool.py\", line 114, in worker\n",
688
+ " task = get()\n",
689
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/queues.py\", line 368, in get\n",
690
+ " return _ForkingPickler.loads(res)\n",
691
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 315, in _bootstrap\n",
692
+ " self.run()\n",
693
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 108, in run\n",
694
+ " self._target(*self._args, **self._kwargs)\n",
695
+ "AttributeError: Can't get attribute 'get_num' on <module '__main__' (built-in)>\n",
696
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/pool.py\", line 114, in worker\n",
697
+ " task = get()\n",
698
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/queues.py\", line 368, in get\n",
699
+ " return _ForkingPickler.loads(res)\n",
700
+ "Traceback (most recent call last):\n",
701
+ "AttributeError: Can't get attribute 'put_num' on <module '__main__' (built-in)>\n",
702
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 315, in _bootstrap\n",
703
+ " self.run()\n",
704
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 108, in run\n",
705
+ " self._target(*self._args, **self._kwargs)\n",
706
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/pool.py\", line 114, in worker\n",
707
+ " task = get()\n",
708
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/queues.py\", line 368, in get\n",
709
+ " return _ForkingPickler.loads(res)\n",
710
+ "AttributeError: Can't get attribute 'put_num' on <module '__main__' (built-in)>\n",
711
+ "Process SpawnPoolWorker-6:\n",
712
+ "Process SpawnPoolWorker-5:\n",
713
+ "Process SpawnPoolWorker-7:\n",
714
+ "Traceback (most recent call last):\n",
715
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 315, in _bootstrap\n",
716
+ " self.run()\n",
717
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 108, in run\n",
718
+ " self._target(*self._args, **self._kwargs)\n",
719
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/pool.py\", line 114, in worker\n",
720
+ " task = get()\n",
721
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/queues.py\", line 365, in get\n",
722
+ " with self._rlock:\n",
723
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/synchronize.py\", line 95, in __enter__\n",
724
+ " return self._semlock.__enter__()\n",
725
+ "Traceback (most recent call last):\n",
726
+ "KeyboardInterrupt\n",
727
+ "Traceback (most recent call last):\n",
728
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 315, in _bootstrap\n",
729
+ " self.run()\n",
730
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 108, in run\n",
731
+ " self._target(*self._args, **self._kwargs)\n",
732
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/pool.py\", line 114, in worker\n",
733
+ " task = get()\n",
734
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/queues.py\", line 366, in get\n",
735
+ " res = self._reader.recv_bytes()\n",
736
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/connection.py\", line 221, in recv_bytes\n",
737
+ " buf = self._recv_bytes(maxlength)\n",
738
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/connection.py\", line 419, in _recv_bytes\n",
739
+ " buf = self._recv(4)\n",
740
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/connection.py\", line 384, in _recv\n",
741
+ " chunk = read(handle, remaining)\n",
742
+ "KeyboardInterrupt\n",
743
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 315, in _bootstrap\n",
744
+ " self.run()\n",
745
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/process.py\", line 108, in run\n",
746
+ " self._target(*self._args, **self._kwargs)\n",
747
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/pool.py\", line 114, in worker\n",
748
+ " task = get()\n",
749
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/queues.py\", line 365, in get\n",
750
+ " with self._rlock:\n",
751
+ " File \"/Users/macbook/opt/anaconda3/lib/python3.9/multiprocessing/synchronize.py\", line 95, in __enter__\n",
752
+ " return self._semlock.__enter__()\n",
753
+ "KeyboardInterrupt\n"
754
+ ]
755
+ },
756
+ {
757
+ "ename": "KeyboardInterrupt",
758
+ "evalue": "",
759
+ "output_type": "error",
760
+ "traceback": [
761
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
762
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
763
+ "Input \u001b[0;32mIn [2]\u001b[0m, in \u001b[0;36m<cell line: 18>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 34\u001b[0m pool\u001b[38;5;241m.\u001b[39mclose()\n\u001b[1;32m 36\u001b[0m \u001b[38;5;66;03m# 进程池中进程执行完毕后再关闭,如果注释,那么程序直接关闭\u001b[39;00m\n\u001b[0;32m---> 37\u001b[0m \u001b[43mpool\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mjoin\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
764
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/multiprocessing/pool.py:662\u001b[0m, in \u001b[0;36mPool.join\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 660\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m (CLOSE, TERMINATE):\n\u001b[1;32m 661\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIn unknown state\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m--> 662\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_worker_handler\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mjoin\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 663\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_task_handler\u001b[38;5;241m.\u001b[39mjoin()\n\u001b[1;32m 664\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_result_handler\u001b[38;5;241m.\u001b[39mjoin()\n",
765
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/threading.py:1053\u001b[0m, in \u001b[0;36mThread.join\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 1050\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcannot join current thread\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 1052\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m timeout \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m-> 1053\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_wait_for_tstate_lock\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1054\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1055\u001b[0m \u001b[38;5;66;03m# the behavior of a negative timeout isn't documented, but\u001b[39;00m\n\u001b[1;32m 1056\u001b[0m \u001b[38;5;66;03m# historically .join(timeout=x) for x<0 has acted as if timeout=0\u001b[39;00m\n\u001b[1;32m 1057\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_wait_for_tstate_lock(timeout\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mmax\u001b[39m(timeout, \u001b[38;5;241m0\u001b[39m))\n",
766
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/threading.py:1073\u001b[0m, in \u001b[0;36mThread._wait_for_tstate_lock\u001b[0;34m(self, block, timeout)\u001b[0m\n\u001b[1;32m 1070\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[1;32m 1072\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1073\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[43mlock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43macquire\u001b[49m\u001b[43m(\u001b[49m\u001b[43mblock\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m)\u001b[49m:\n\u001b[1;32m 1074\u001b[0m lock\u001b[38;5;241m.\u001b[39mrelease()\n\u001b[1;32m 1075\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stop()\n",
767
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
768
+ ]
769
+ }
770
+ ],
771
+ "source": [
772
+ "\"\"\"jupyter notebook中,下���代码无法被正常执行,请在Pycharm中尝试\"\"\"\n",
773
+ "\n",
774
+ "from multiprocessing import Pool, Manager\n",
775
+ "\n",
776
+ "\n",
777
+ "def put_num(info_queue, l):\n",
778
+ " \"\"\"添加数字\"\"\"\n",
779
+ " for n in l:\n",
780
+ " info_queue.put(n)\n",
781
+ "\n",
782
+ "\n",
783
+ "def get_num(info_queue):\n",
784
+ " \"\"\"获取数字\"\"\"\n",
785
+ " \n",
786
+ " # 当队列不为空时,获取数字\n",
787
+ " while not info_queue.empty():\n",
788
+ " print(info_queue.get())\n",
789
+ "\n",
790
+ "\n",
791
+ "if __name__ == '__main__':\n",
792
+ "\n",
793
+ " # 创建 Queue队列\n",
794
+ " html_queue = Manager().Queue()\n",
795
+ " a = [11, 12, 13, 14, 15]\n",
796
+ " b = [1, 2, 3, 4, 5]\n",
797
+ "\n",
798
+ " # 创建容量为3 的进程池\n",
799
+ " pool = Pool(3)\n",
800
+ "\n",
801
+ " # 异步执行\n",
802
+ " pool.apply_async(func=put_num, args=(html_queue, a))\n",
803
+ " pool.apply_async(func=put_num, args=(html_queue, b))\n",
804
+ " pool.apply_async(func=get_num, args=(html_queue,))\n",
805
+ "\n",
806
+ " # 这里join一定是在close之后,且必须要加join,否则主进程不等待创建的子进程执行完毕\n",
807
+ " pool.close()\n",
808
+ "\n",
809
+ " # 进程池中进程执行完毕后再关闭,如果注释,那么程序直接关闭\n",
810
+ " pool.join()"
811
+ ]
812
+ },
813
+ {
814
+ "cell_type": "code",
815
+ "execution_count": null,
816
+ "id": "5b6faf7c",
817
+ "metadata": {},
818
+ "outputs": [],
819
+ "source": [
820
+ "\"\"\"jupyter notebook中,下列代码无法被正常执行,请在Pycharm中尝试\"\"\"\n",
821
+ "\n",
822
+ "from multiprocessing import Pool, Manager\n",
823
+ "from time import sleep\n",
824
+ "\n",
825
+ "\n",
826
+ "def spider(url_queue):\n",
827
+ " \n",
828
+ " # 如果 URL队列不为空\n",
829
+ " while not url_queue.empty():\n",
830
+ " try:\n",
831
+ " \n",
832
+ " # 获取 URL\n",
833
+ " url = url_queue.get(timeout=1)\n",
834
+ " \n",
835
+ " print(f'成功获取{url}')\n",
836
+ " \n",
837
+ " sleep(1)\n",
838
+ " \n",
839
+ " except Exception as e:\n",
840
+ " print(e)\n",
841
+ "\n",
842
+ "\n",
843
+ "if __name__ == '__main__':\n",
844
+ "\n",
845
+ " # 创建 队列\n",
846
+ " url_queue = Manager().Queue()\n",
847
+ "\n",
848
+ " # 为队列 添加 URL地址\n",
849
+ " for i in range(1, 11):\n",
850
+ " url = f'https://www.hupu.com/home/v1/news?pageNo={i}&pageSize=50'\n",
851
+ " url_queue.put(url)\n",
852
+ "\n",
853
+ " # 创建 容量为3的进程池\n",
854
+ " pool = Pool(3)\n",
855
+ "\n",
856
+ " # 异步执行\n",
857
+ " pool.apply_async(func=spider, args=(url_queue,))\n",
858
+ " pool.apply_async(func=spider, args=(url_queue,))\n",
859
+ " pool.apply_async(func=spider, args=(url_queue,))\n",
860
+ " \n",
861
+ " # 关闭进程池\n",
862
+ " pool.close()\n",
863
+ " \n",
864
+ " # 等待子进程结束,主进程才结束\n",
865
+ " pool.join()"
866
+ ]
867
+ },
868
+ {
869
+ "cell_type": "markdown",
870
+ "id": "db345218",
871
+ "metadata": {},
872
+ "source": [
873
+ "## 多协程爬虫"
874
+ ]
875
+ },
876
+ {
877
+ "cell_type": "markdown",
878
+ "id": "a82ee42e",
879
+ "metadata": {},
880
+ "source": [
881
+ "### 示例"
882
+ ]
883
+ },
884
+ {
885
+ "cell_type": "code",
886
+ "execution_count": 1,
887
+ "id": "69c0c319",
888
+ "metadata": {
889
+ "ExecuteTime": {
890
+ "end_time": "2023-10-25T10:22:25.388668Z",
891
+ "start_time": "2023-10-25T10:22:24.951333Z"
892
+ },
893
+ "collapsed": true
894
+ },
895
+ "outputs": [
896
+ {
897
+ "ename": "RuntimeError",
898
+ "evalue": "This event loop is already running",
899
+ "output_type": "error",
900
+ "traceback": [
901
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
902
+ "\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)",
903
+ "Input \u001b[0;32mIn [1]\u001b[0m, in \u001b[0;36m<cell line: 24>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 21\u001b[0m loop \u001b[38;5;241m=\u001b[39m asyncio\u001b[38;5;241m.\u001b[39mget_event_loop()\n\u001b[1;32m 23\u001b[0m \u001b[38;5;66;03m# 执行 main函数\u001b[39;00m\n\u001b[0;32m---> 24\u001b[0m \u001b[43mloop\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun_until_complete\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmain\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n",
904
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/asyncio/base_events.py:623\u001b[0m, in \u001b[0;36mBaseEventLoop.run_until_complete\u001b[0;34m(self, future)\u001b[0m\n\u001b[1;32m 612\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Run until the Future is done.\u001b[39;00m\n\u001b[1;32m 613\u001b[0m \n\u001b[1;32m 614\u001b[0m \u001b[38;5;124;03mIf the argument is a coroutine, it is wrapped in a Task.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 620\u001b[0m \u001b[38;5;124;03mReturn the Future's result, or raise its exception.\u001b[39;00m\n\u001b[1;32m 621\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 622\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_check_closed()\n\u001b[0;32m--> 623\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_check_running\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 625\u001b[0m new_task \u001b[38;5;241m=\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m futures\u001b[38;5;241m.\u001b[39misfuture(future)\n\u001b[1;32m 626\u001b[0m future \u001b[38;5;241m=\u001b[39m tasks\u001b[38;5;241m.\u001b[39mensure_future(future, loop\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m)\n",
905
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/asyncio/base_events.py:583\u001b[0m, in \u001b[0;36mBaseEventLoop._check_running\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 581\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_check_running\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 582\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mis_running():\n\u001b[0;32m--> 583\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mThis event loop is already running\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 584\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m events\u001b[38;5;241m.\u001b[39m_get_running_loop() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 585\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\n\u001b[1;32m 586\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mCannot run the event loop while another loop is running\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
906
+ "\u001b[0;31mRuntimeError\u001b[0m: This event loop is already running"
907
+ ]
908
+ }
909
+ ],
910
+ "source": [
911
+ "import aiohttp\n",
912
+ "import asyncio\n",
913
+ "\n",
914
+ "async def main():\n",
915
+ " \n",
916
+ " # 对网址发送 GET请求\n",
917
+ " async with aiohttp.ClientSession() as session:\n",
918
+ " async with session.get('http://python.org') as response:\n",
919
+ " \n",
920
+ " # 打印 响应码\n",
921
+ " print(\"Status:\", response.status)\n",
922
+ " \n",
923
+ " # 打印 获取的数据类型\n",
924
+ " print(\"Content-type:\", response.headers['content-type'])\n",
925
+ "\n",
926
+ " # 获取内容\n",
927
+ " html = await response.text()\n",
928
+ " print(\"Body:\", html[:15], \"...\")\n",
929
+ "\n",
930
+ "# 创建 协程\n",
931
+ "loop = asyncio.get_event_loop()\n",
932
+ "\n",
933
+ "# 执行 main函数\n",
934
+ "loop.run_until_complete(main())"
935
+ ]
936
+ },
937
+ {
938
+ "cell_type": "markdown",
939
+ "id": "effccca2",
940
+ "metadata": {},
941
+ "source": [
942
+ "### clientSession的使用"
943
+ ]
944
+ },
945
+ {
946
+ "cell_type": "code",
947
+ "execution_count": 5,
948
+ "id": "affbdf5e",
949
+ "metadata": {
950
+ "ExecuteTime": {
951
+ "end_time": "2023-10-26T00:04:43.295619Z",
952
+ "start_time": "2023-10-26T00:04:42.477263Z"
953
+ }
954
+ },
955
+ "outputs": [],
956
+ "source": [
957
+ "\"\"\"header设置\"\"\"\n",
958
+ "import aiohttp\n",
959
+ "import asyncio\n",
960
+ "\n",
961
+ "# 设置请求头\n",
962
+ "headers = {\"Authorization\": \"Basic bG9naW46cGFzcw==\"}\n",
963
+ "\n",
964
+ "# 发送 GET请求\n",
965
+ "async with aiohttp.ClientSession(headers=headers) as session:\n",
966
+ " async with session.get(\"http://httpbin.org/headers\") as r:\n",
967
+ " \n",
968
+ " # 转成 Json格式\n",
969
+ " json_body = await r.json()\n",
970
+ " \n",
971
+ " # 设置\n",
972
+ " assert json_body['headers']['Authorization'] == 'Basic bG9naW46cGFzcw=='"
973
+ ]
974
+ },
975
+ {
976
+ "cell_type": "code",
977
+ "execution_count": 6,
978
+ "id": "3589b7dc",
979
+ "metadata": {
980
+ "ExecuteTime": {
981
+ "end_time": "2023-10-26T00:04:46.654372Z",
982
+ "start_time": "2023-10-26T00:04:46.069363Z"
983
+ }
984
+ },
985
+ "outputs": [],
986
+ "source": [
987
+ "\"\"\"Cookie的使用\"\"\"\n",
988
+ "\n",
989
+ "url = 'http://httpbin.org/cookies'\n",
990
+ "cookies = {'cookies_are': 'working'}\n",
991
+ "\n",
992
+ "# 设置 cookies,发送 GET请求\n",
993
+ "async with aiohttp.ClientSession(cookies=cookies) as session:\n",
994
+ " async with session.get(url) as resp:\n",
995
+ " assert await resp.json() == {\"cookies\": {\"cookies_are\": \"working\"}}"
996
+ ]
997
+ },
998
+ {
999
+ "cell_type": "code",
1000
+ "execution_count": 7,
1001
+ "id": "a8b43aa4",
1002
+ "metadata": {
1003
+ "ExecuteTime": {
1004
+ "end_time": "2023-10-26T00:04:49.444359Z",
1005
+ "start_time": "2023-10-26T00:04:48.799486Z"
1006
+ }
1007
+ },
1008
+ "outputs": [
1009
+ {
1010
+ "name": "stdout",
1011
+ "output_type": "stream",
1012
+ "text": [
1013
+ "400\n"
1014
+ ]
1015
+ }
1016
+ ],
1017
+ "source": [
1018
+ "\"\"\"Proxy的使用\"\"\"\n",
1019
+ "\n",
1020
+ "# 发送 GET请求,设置代理\n",
1021
+ "async with aiohttp.ClientSession() as session:\n",
1022
+ " async with session.get(\"http://python.org\", proxy=\"http://proxy.com\") as resp:\n",
1023
+ " \n",
1024
+ " # 获取状态\n",
1025
+ " print(resp.status)"
1026
+ ]
1027
+ },
1028
+ {
1029
+ "cell_type": "markdown",
1030
+ "id": "2f39bdee",
1031
+ "metadata": {},
1032
+ "source": [
1033
+ "**Response的使用**\n",
1034
+ "\n",
1035
+ "- 属性\n",
1036
+ " - status 状态码\n",
1037
+ " - url url地址\n",
1038
+ " - cookies cookie内容\n",
1039
+ " - headers 响应头\n",
1040
+ " \n",
1041
+ "- 方法\n",
1042
+ " - read() 读bytes类型\n",
1043
+ " - text() 读文本内容"
1044
+ ]
1045
+ },
1046
+ {
1047
+ "cell_type": "code",
1048
+ "execution_count": 11,
1049
+ "id": "2bcda6dd",
1050
+ "metadata": {
1051
+ "ExecuteTime": {
1052
+ "end_time": "2023-10-26T00:28:26.494061Z",
1053
+ "start_time": "2023-10-26T00:28:26.434772Z"
1054
+ },
1055
+ "collapsed": true
1056
+ },
1057
+ "outputs": [
1058
+ {
1059
+ "ename": "RuntimeError",
1060
+ "evalue": "This event loop is already running",
1061
+ "output_type": "error",
1062
+ "traceback": [
1063
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
1064
+ "\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)",
1065
+ "Input \u001b[0;32mIn [11]\u001b[0m, in \u001b[0;36m<cell line: 61>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 61\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;18m__name__\u001b[39m \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m__main__\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m 62\u001b[0m \n\u001b[1;32m 63\u001b[0m \u001b[38;5;66;03m# 启动协程\u001b[39;00m\n\u001b[1;32m 64\u001b[0m loop \u001b[38;5;241m=\u001b[39m asyncio\u001b[38;5;241m.\u001b[39mget_event_loop()\n\u001b[0;32m---> 65\u001b[0m \u001b[43mloop\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun_until_complete\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtest_cookie\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n",
1066
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/asyncio/base_events.py:623\u001b[0m, in \u001b[0;36mBaseEventLoop.run_until_complete\u001b[0;34m(self, future)\u001b[0m\n\u001b[1;32m 612\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Run until the Future is done.\u001b[39;00m\n\u001b[1;32m 613\u001b[0m \n\u001b[1;32m 614\u001b[0m \u001b[38;5;124;03mIf the argument is a coroutine, it is wrapped in a Task.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 620\u001b[0m \u001b[38;5;124;03mReturn the Future's result, or raise its exception.\u001b[39;00m\n\u001b[1;32m 621\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 622\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_check_closed()\n\u001b[0;32m--> 623\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_check_running\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 625\u001b[0m new_task \u001b[38;5;241m=\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m futures\u001b[38;5;241m.\u001b[39misfuture(future)\n\u001b[1;32m 626\u001b[0m future \u001b[38;5;241m=\u001b[39m tasks\u001b[38;5;241m.\u001b[39mensure_future(future, loop\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m)\n",
1067
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/asyncio/base_events.py:583\u001b[0m, in \u001b[0;36mBaseEventLoop._check_running\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 581\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_check_running\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 582\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mis_running():\n\u001b[0;32m--> 583\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mThis event loop is already running\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 584\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m events\u001b[38;5;241m.\u001b[39m_get_running_loop() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 585\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\n\u001b[1;32m 586\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mCannot run the event loop while another loop is running\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
1068
+ "\u001b[0;31mRuntimeError\u001b[0m: This event loop is already running"
1069
+ ]
1070
+ }
1071
+ ],
1072
+ "source": [
1073
+ "import aiohttp\n",
1074
+ "import asyncio\n",
1075
+ "\n",
1076
+ "\n",
1077
+ "async def first():\n",
1078
+ " \n",
1079
+ " # 发送 GET请求\n",
1080
+ " async with aiohttp.ClientSession() as session: # aiohttp.ClientSession() == import requests 模块\n",
1081
+ " async with session.get('http://httpbin.org/get') as resp:\n",
1082
+ " \n",
1083
+ " # 获取内容\n",
1084
+ " rs = await resp.text()\n",
1085
+ " print(rs[:100])\n",
1086
+ "\n",
1087
+ "headers = {'User-Agent': 'aaaaaa123'}\n",
1088
+ "\n",
1089
+ "async def test_header():\n",
1090
+ " \n",
1091
+ " # 设置请求头,发送 GET请求\n",
1092
+ " async with aiohttp.ClientSession(headers=headers) as session:\n",
1093
+ " async with session.get('http://httpbin.org/get') as resp:\n",
1094
+ " \n",
1095
+ " # 获取内容\n",
1096
+ " rs = await resp.text()\n",
1097
+ " print(rs[:100])\n",
1098
+ "\n",
1099
+ "\n",
1100
+ "async def test_params():\n",
1101
+ " \n",
1102
+ " # 设置请求头,发送带参数的 GET请求\n",
1103
+ " async with aiohttp.ClientSession(headers=headers) as session:\n",
1104
+ " async with session.get('http://httpbin.org/get', params={'name': 'bjsxt'}) as resp:\n",
1105
+ " \n",
1106
+ " # 获取内容\n",
1107
+ " rs = await resp.text()\n",
1108
+ " print(rs[:100])\n",
1109
+ "\n",
1110
+ "\n",
1111
+ "async def test_cookie():\n",
1112
+ " \n",
1113
+ " # 设置请求头,添加 cookies,发送带参数的 GET请求\n",
1114
+ " async with aiohttp.ClientSession(headers=headers, cookies={'token': 'sxt123id'}) as session:\n",
1115
+ " async with session.get('http://httpbin.org/get', params={'name': 'bjsxt'}) as resp:\n",
1116
+ " \n",
1117
+ " # 获取内容\n",
1118
+ " rs = await resp.text()\n",
1119
+ " print(rs[:100])\n",
1120
+ "\n",
1121
+ "\n",
1122
+ "async def test_proxy():\n",
1123
+ " \n",
1124
+ " # 设置请求头,添加 cookies与代理,发送带参数的 GET请求\n",
1125
+ " async with aiohttp.ClientSession(headers=headers, cookies={'token': 'sxt123id'}) as session:\n",
1126
+ " async with session.get('http://httpbin.org/get', params={'name': 'bjsxt'}, proxy='http://name:pwd@ip:port') as resp:\n",
1127
+ " \n",
1128
+ " # 获取内容\n",
1129
+ " rs = await resp.text()\n",
1130
+ " print(rs)\n",
1131
+ "\n",
1132
+ "\n",
1133
+ "if __name__ == '__main__':\n",
1134
+ " \n",
1135
+ " # 启动协程\n",
1136
+ " loop = asyncio.get_event_loop()\n",
1137
+ " loop.run_until_complete(test_cookie())"
1138
+ ]
1139
+ },
1140
+ {
1141
+ "cell_type": "markdown",
1142
+ "id": "e0c18202",
1143
+ "metadata": {},
1144
+ "source": [
1145
+ "## Selenium初步使用"
1146
+ ]
1147
+ },
1148
+ {
1149
+ "cell_type": "code",
1150
+ "execution_count": 14,
1151
+ "id": "4d09b0cc",
1152
+ "metadata": {
1153
+ "ExecuteTime": {
1154
+ "end_time": "2023-10-26T00:53:20.927547Z",
1155
+ "start_time": "2023-10-26T00:53:17.865837Z"
1156
+ }
1157
+ },
1158
+ "outputs": [
1159
+ {
1160
+ "name": "stdout",
1161
+ "output_type": "stream",
1162
+ "text": [
1163
+ "<html><head><script type=\"text/javascript\" charset=\"utf-8\" src=\"https://pss.bdstatic.com/static/supe\n",
1164
+ "[{'domain': '.baidu.com', 'expiry': 1729817600, 'httpOnly': False, 'name': 'ZFY', 'path': '/', 'sameSite': 'None', 'secure': True, 'value': 'kcGUACtNx2KdcyAwkb5ceh:A3UjfLUmFqpYcyMSLBRvY:C'}, {'domain': '.baidu.com', 'expiry': 1729817600, 'httpOnly': False, 'name': 'BAIDUID_BFESS', 'path': '/', 'sameSite': 'None', 'secure': True, 'value': '47CBFCBBA3EF8A5E6F7B68CA454E422F:FG=1'}, {'domain': '.baidu.com', 'expiry': 1698368000, 'httpOnly': False, 'name': 'BA_HECTOR', 'path': '/', 'sameSite': 'Lax', 'secure': False, 'value': 'ada020a100a5004ha18h20aa1ijje401p'}, {'domain': 'www.baidu.com', 'expiry': 1698281600, 'httpOnly': False, 'name': 'BD_LAST_QID', 'path': '/', 'sameSite': 'Lax', 'secure': False, 'value': '11234071065355764699'}, {'domain': '.baidu.com', 'expiry': 1729817599, 'httpOnly': False, 'name': 'BAIDUID', 'path': '/', 'sameSite': 'Lax', 'secure': False, 'value': '47CBFCBBA3EF8A5E6F7B68CA454E422F:FG=1'}, {'domain': '.baidu.com', 'expiry': 1732841599, 'httpOnly': False, 'name': 'BIDUPSID', 'path': '/', 'sameSite': 'Lax', 'secure': False, 'value': '47CBFCBBA3EF8A5ED89D46B5AFB538E7'}, {'domain': '.baidu.com', 'expiry': 1732841599, 'httpOnly': False, 'name': 'PSTM', 'path': '/', 'sameSite': 'Lax', 'secure': False, 'value': '1698281600'}, {'domain': 'www.baidu.com', 'expiry': 1699145600, 'httpOnly': False, 'name': 'BD_UPN', 'path': '/', 'sameSite': 'Lax', 'secure': False, 'value': '123253'}]\n",
1165
+ "https://www.baidu.com/\n"
1166
+ ]
1167
+ }
1168
+ ],
1169
+ "source": [
1170
+ "# 导入 webdriver\n",
1171
+ "from selenium import webdriver\n",
1172
+ "\n",
1173
+ "# 要想调用键盘按键操作需要引入keys包\n",
1174
+ "from selenium.webdriver.common.keys import Keys\n",
1175
+ "\n",
1176
+ "# 创建 浏览器对象\n",
1177
+ "driver = webdriver.Chrome()\n",
1178
+ "\n",
1179
+ "# 对浏览器发送 GET请求\n",
1180
+ "driver.get(\"http://www.baidu.com/\")\n",
1181
+ "\n",
1182
+ "# 获取网页的源代码\n",
1183
+ "print(driver.page_source[:100])\n",
1184
+ "\n",
1185
+ "# 获取当前页面 Cookie\n",
1186
+ "print(driver.get_cookies())\n",
1187
+ "\n",
1188
+ "# 生成新的页面快照\n",
1189
+ "driver.save_screenshot(\"./data/python爬虫.png\")\n",
1190
+ "\n",
1191
+ "# 获取当前 url\n",
1192
+ "print(driver.current_url)\n",
1193
+ "\n",
1194
+ "# 关闭浏览器\n",
1195
+ "driver.quit()\n"
1196
+ ]
1197
+ },
1198
+ {
1199
+ "cell_type": "code",
1200
+ "execution_count": 15,
1201
+ "id": "e6d96ba8",
1202
+ "metadata": {
1203
+ "ExecuteTime": {
1204
+ "end_time": "2023-10-26T00:57:07.657648Z",
1205
+ "start_time": "2023-10-26T00:57:02.625434Z"
1206
+ }
1207
+ },
1208
+ "outputs": [],
1209
+ "source": [
1210
+ "from selenium import webdriver\n",
1211
+ "from time import sleep\n",
1212
+ "\n",
1213
+ "# 创建 chrome浏览器对象\n",
1214
+ "chrome = webdriver.Chrome()\n",
1215
+ "\n",
1216
+ "# 发送 GET请求\n",
1217
+ "chrome.get('http://www.baidu.com/')\n",
1218
+ "\n",
1219
+ "# 获取页面源代码\n",
1220
+ "html = chrome.page_source\n",
1221
+ "\n",
1222
+ "# 获取页面的 URL地址\n",
1223
+ "url = chrome.current_url\n",
1224
+ "\n",
1225
+ "# 保存页面的快照\n",
1226
+ "chrome.save_screenshot('./baidu.png')\n",
1227
+ "\n",
1228
+ "sleep(2)\n",
1229
+ "\n",
1230
+ "# 退出浏览器\n",
1231
+ "chrome.quit()"
1232
+ ]
1233
+ },
1234
+ {
1235
+ "cell_type": "markdown",
1236
+ "id": "b5cad107",
1237
+ "metadata": {},
1238
+ "source": [
1239
+ "## Selenium 控制浏览器"
1240
+ ]
1241
+ },
1242
+ {
1243
+ "cell_type": "markdown",
1244
+ "id": "387447bb",
1245
+ "metadata": {},
1246
+ "source": [
1247
+ "### 最大化窗口\n",
1248
+ "\n",
1249
+ "我们知道调用启动的浏览器 不是全屏的,这样不会影响脚本的执行,但是有时候会影响我们“观看”脚本的执行"
1250
+ ]
1251
+ },
1252
+ {
1253
+ "cell_type": "code",
1254
+ "execution_count": 18,
1255
+ "id": "44d1b503",
1256
+ "metadata": {
1257
+ "ExecuteTime": {
1258
+ "end_time": "2023-10-26T01:00:10.396756Z",
1259
+ "start_time": "2023-10-26T01:00:05.857485Z"
1260
+ }
1261
+ },
1262
+ "outputs": [],
1263
+ "source": [
1264
+ "from selenium import webdriver\n",
1265
+ "from time import sleep\n",
1266
+ "\n",
1267
+ "# 创建 浏览器对象\n",
1268
+ "browser = webdriver.Chrome()\n",
1269
+ "\n",
1270
+ "# 发送 GET请求\n",
1271
+ "url= 'http://www.baidu.com'\n",
1272
+ "browser.get(url)\n",
1273
+ "\n",
1274
+ "# 最大化窗口\n",
1275
+ "browser.maximize_window()\n",
1276
+ "\n",
1277
+ "sleep(2)\n",
1278
+ "\n",
1279
+ "# 退出浏览器\n",
1280
+ "browser.quit()"
1281
+ ]
1282
+ },
1283
+ {
1284
+ "cell_type": "markdown",
1285
+ "id": "754c3d1d",
1286
+ "metadata": {},
1287
+ "source": [
1288
+ "### 设置宽与高\n"
1289
+ ]
1290
+ },
1291
+ {
1292
+ "cell_type": "code",
1293
+ "execution_count": 19,
1294
+ "id": "687ed5cb",
1295
+ "metadata": {
1296
+ "ExecuteTime": {
1297
+ "end_time": "2023-10-26T01:01:49.260102Z",
1298
+ "start_time": "2023-10-26T01:01:45.136593Z"
1299
+ }
1300
+ },
1301
+ "outputs": [],
1302
+ "source": [
1303
+ "from selenium import webdriver\n",
1304
+ "from time import sleep\n",
1305
+ "\n",
1306
+ "# 创建 浏览器对象\n",
1307
+ "browser = webdriver.Chrome()\n",
1308
+ "\n",
1309
+ "# 发送 GET请求\n",
1310
+ "url = 'http://www.baidu.com'\n",
1311
+ "browser.get(url)\n",
1312
+ "\n",
1313
+ "# 设置窗口大小\n",
1314
+ "browser.set_window_size(500, 600)\n",
1315
+ "\n",
1316
+ "sleep(2)\n",
1317
+ "\n",
1318
+ "# 退出浏览器\n",
1319
+ "browser.quit()"
1320
+ ]
1321
+ },
1322
+ {
1323
+ "cell_type": "markdown",
1324
+ "id": "60660ca9",
1325
+ "metadata": {},
1326
+ "source": [
1327
+ "### 浏览器 前进、后退\n",
1328
+ "\n",
1329
+ "浏览器上有一个后退、前进按钮,对于浏览网页的人是比较方便的;"
1330
+ ]
1331
+ },
1332
+ {
1333
+ "cell_type": "code",
1334
+ "execution_count": 21,
1335
+ "id": "815d9cc7",
1336
+ "metadata": {
1337
+ "ExecuteTime": {
1338
+ "end_time": "2023-10-26T01:05:15.167928Z",
1339
+ "start_time": "2023-10-26T01:05:04.571286Z"
1340
+ }
1341
+ },
1342
+ "outputs": [],
1343
+ "source": [
1344
+ "from selenium import webdriver\n",
1345
+ "import time\n",
1346
+ "\n",
1347
+ "# 创建 浏览器对象\n",
1348
+ "browser = webdriver.Chrome()\n",
1349
+ "\n",
1350
+ "# 发送 GET请求,访问百度首页\n",
1351
+ "first_url = 'http://www.baidu.com'\n",
1352
+ "browser.get(first_url)\n",
1353
+ "\n",
1354
+ "time.sleep(2)\n",
1355
+ "\n",
1356
+ "# 发送 GET请求,访问新闻页面\n",
1357
+ "second_url = 'http://news.baidu.com'\n",
1358
+ "browser.get(second_url)\n",
1359
+ "\n",
1360
+ "time.sleep(2) \n",
1361
+ "\n",
1362
+ "# 返回(后退)到 百度首页\n",
1363
+ "browser.back()\n",
1364
+ "time.sleep(1) \n",
1365
+ " \n",
1366
+ "# 前进到 新闻页\n",
1367
+ "browser.forward()\n",
1368
+ "time.sleep(2)\n",
1369
+ "\n",
1370
+ "# 退出浏览器\n",
1371
+ "browser.quit()"
1372
+ ]
1373
+ },
1374
+ {
1375
+ "cell_type": "code",
1376
+ "execution_count": 22,
1377
+ "id": "70f69a4a",
1378
+ "metadata": {
1379
+ "ExecuteTime": {
1380
+ "end_time": "2023-10-26T01:09:57.812640Z",
1381
+ "start_time": "2023-10-26T01:09:26.865446Z"
1382
+ }
1383
+ },
1384
+ "outputs": [],
1385
+ "source": [
1386
+ "from selenium import webdriver\n",
1387
+ "from time import sleep\n",
1388
+ "\n",
1389
+ "\n",
1390
+ "def test01():\n",
1391
+ " \n",
1392
+ " # 创建 浏览器对象\n",
1393
+ " chrome = webdriver.Chrome()\n",
1394
+ " \n",
1395
+ " # 发送 GET请求\n",
1396
+ " url = 'http://www.baidu.com'\n",
1397
+ " chrome.get(url)\n",
1398
+ " \n",
1399
+ " # 最大化窗口\n",
1400
+ " chrome.maximize_window()\n",
1401
+ " \n",
1402
+ " sleep(3)\n",
1403
+ " \n",
1404
+ " # 退出浏览器\n",
1405
+ " chrome.quit()\n",
1406
+ "\n",
1407
+ "\n",
1408
+ "def test02():\n",
1409
+ " \n",
1410
+ " # 创建 浏览器对象\n",
1411
+ " chrome = webdriver.Chrome()\n",
1412
+ " \n",
1413
+ " # 发送 GET请求\n",
1414
+ " url = 'http://www.baidu.com'\n",
1415
+ " chrome.get(url)\n",
1416
+ " \n",
1417
+ " # 设置浏览器宽与高\n",
1418
+ " chrome.set_window_size(500, 600) \n",
1419
+ " \n",
1420
+ " sleep(3)\n",
1421
+ " \n",
1422
+ " # 退出浏览器\n",
1423
+ " chrome.quit()\n",
1424
+ "\n",
1425
+ "\n",
1426
+ "def test03():\n",
1427
+ " \n",
1428
+ " # 创建 浏览器对象\n",
1429
+ " chrome = webdriver.Chrome()\n",
1430
+ " \n",
1431
+ " # 发送 GET请求\n",
1432
+ " url = 'http://www.baidu.com'\n",
1433
+ " chrome.get(url)\n",
1434
+ " \n",
1435
+ " sleep(2)\n",
1436
+ " \n",
1437
+ " # 发送 GET请求\n",
1438
+ " chrome.get('http://www.bjsxt.com/')\n",
1439
+ " sleep(3)\n",
1440
+ " \n",
1441
+ " # 后退\n",
1442
+ " chrome.back() \n",
1443
+ " sleep(2)\n",
1444
+ " \n",
1445
+ " # 前进\n",
1446
+ " chrome.forward() \n",
1447
+ " sleep(3)\n",
1448
+ " \n",
1449
+ " # 退出浏览器\n",
1450
+ " chrome.quit()\n",
1451
+ "\n",
1452
+ "\n",
1453
+ "if __name__ == '__main__':\n",
1454
+ " test01()\n",
1455
+ " test02()\n",
1456
+ " test03()"
1457
+ ]
1458
+ },
1459
+ {
1460
+ "cell_type": "markdown",
1461
+ "id": "19a6313a",
1462
+ "metadata": {},
1463
+ "source": [
1464
+ "## Selenium 基本操作"
1465
+ ]
1466
+ },
1467
+ {
1468
+ "cell_type": "markdown",
1469
+ "id": "5a1f1142",
1470
+ "metadata": {},
1471
+ "source": [
1472
+ "对象的定位应该是自动化的核心,要想操作一个对象,首先应该识别这个对象。\n",
1473
+ "\n",
1474
+ "一个对象就像人一样,他会有各种的特征(属性)\n",
1475
+ "\n",
1476
+ "### 对象定位\n",
1477
+ "\n",
1478
+ "webdriver提供了一系列的对象定位方法,常用的有以下几种:\n",
1479
+ "\n",
1480
+ "\n",
1481
+ "利用 By 类来确定哪种选择方式\n",
1482
+ "\n",
1483
+ "```shell\n",
1484
+ "from selenium.webdriver.common.by import By\n",
1485
+ "```\n",
1486
+ "\n",
1487
+ "**By 类的一些属性如下:**\n",
1488
+ "\n",
1489
+ "- ID = \"id\"\n",
1490
+ "- XPATH = \"xpath\"\n",
1491
+ "- LINK_TEXT = \"link text\"\n",
1492
+ "- PARTIAL_LINK_TEXT = \"partial link text\"\n",
1493
+ "- NAME = \"name\"\n",
1494
+ "- TAG_NAME = \"tag name\"\n",
1495
+ "- CLASS_NAME = \"class name\"\n",
1496
+ "- CSS_SELECTOR = \"css selector\"\n"
1497
+ ]
1498
+ },
1499
+ {
1500
+ "cell_type": "code",
1501
+ "execution_count": 37,
1502
+ "id": "cc04d4b0",
1503
+ "metadata": {
1504
+ "ExecuteTime": {
1505
+ "end_time": "2023-10-26T01:34:43.669953Z",
1506
+ "start_time": "2023-10-26T01:34:36.555182Z"
1507
+ }
1508
+ },
1509
+ "outputs": [],
1510
+ "source": [
1511
+ "from selenium import webdriver\n",
1512
+ "from time import sleep\n",
1513
+ "from selenium.webdriver.common.by import By\n",
1514
+ "\n",
1515
+ "# 创建 浏览器\n",
1516
+ "browser = webdriver.Chrome()\n",
1517
+ "\n",
1518
+ "# 发送 GET请求\n",
1519
+ "browser.get(\"http://www.baidu.com\")\n",
1520
+ "time.sleep(2)\n",
1521
+ "\n",
1522
+ "## 百度输入框的定位方式\n",
1523
+ "# 通过 id方式定位\n",
1524
+ "browser.find_element(by=By.ID, value=\"kw\").send_keys(\"selenium\")\n",
1525
+ "\n",
1526
+ "\"\"\"\n",
1527
+ "# 通过 name方式定位\n",
1528
+ "browser.find_element(by=By.NAME, value=\"kw\").send_keys(\"selenium\")\n",
1529
+ "\n",
1530
+ "# 通过 tag name方式定位\n",
1531
+ "browser.find_element(by=By.TAG_NAME, value=\"input\").send_keys(\"selenium\")\n",
1532
+ "\n",
1533
+ "# 通过 class name 方式定位\n",
1534
+ "browser.find_element(by=By.CLASS_NAME, value=\"s_ipt\").send_keys(\"selenium\")\n",
1535
+ "\n",
1536
+ "# 通过 CSS方式定位\n",
1537
+ "browser.find_element(by=By.CSS_SELECTOR, value=\"#kw\").send_keys(\"selenium\")\n",
1538
+ "\n",
1539
+ "# 通过 xphan方式定位\n",
1540
+ "browser.find_element(by=By.XPATH, value=\"//input[@id='kw']\").send_keys(\"selenium\")\n",
1541
+ "\"\"\"\n",
1542
+ "\n",
1543
+ "# 定位搜索按钮,并进行点击\n",
1544
+ "browser.find_element(by=By.ID, value=\"su\").click()\n",
1545
+ "\n",
1546
+ "\n",
1547
+ "time.sleep(3)\n",
1548
+ "\n",
1549
+ "# 退出浏览器\n",
1550
+ "browser.quit()"
1551
+ ]
1552
+ },
1553
+ {
1554
+ "cell_type": "markdown",
1555
+ "id": "2dd808c8",
1556
+ "metadata": {},
1557
+ "source": [
1558
+ "### 层级定位\n",
1559
+ "\n",
1560
+ "在实际的开发中也经常会遇到这种问题:页面上有很多个属性基本相同的元素,现在需要具体定位到其中的一个。\n",
1561
+ "\n",
1562
+ "由于属性基本相当,所以在定位的时候会有些麻烦,这时候就需要用到层级定位。先定位父元素,然后再通过父元素定位子孙元素"
1563
+ ]
1564
+ },
1565
+ {
1566
+ "cell_type": "markdown",
1567
+ "id": "f0f14501",
1568
+ "metadata": {},
1569
+ "source": [
1570
+ "**具体思路是:** 先点击显示出 1个下拉菜单,然后再定位到该下拉菜单所在的ul,再定位这个ul下的某个具体的link。在这里,我们定位第1个下拉菜单中的Action这个选项。"
1571
+ ]
1572
+ },
1573
+ {
1574
+ "cell_type": "code",
1575
+ "execution_count": 42,
1576
+ "id": "dc2e472f",
1577
+ "metadata": {
1578
+ "ExecuteTime": {
1579
+ "end_time": "2023-10-26T01:50:20.104584Z",
1580
+ "start_time": "2023-10-26T01:50:15.392900Z"
1581
+ },
1582
+ "scrolled": true
1583
+ },
1584
+ "outputs": [
1585
+ {
1586
+ "name": "stdout",
1587
+ "output_type": "stream",
1588
+ "text": [
1589
+ "file:////Users/macbook/Documents/Python全栈/06_Python爬虫/html/level_locate.html\n"
1590
+ ]
1591
+ }
1592
+ ],
1593
+ "source": [
1594
+ "from selenium import webdriver\n",
1595
+ "from selenium.webdriver.support.ui import WebDriverWait\n",
1596
+ "from selenium.webdriver.common.by import By\n",
1597
+ "import time\n",
1598
+ "import os\n",
1599
+ "\n",
1600
+ "# 创建 浏览器对象\n",
1601
+ "chrome = webdriver.Chrome()\n",
1602
+ "\n",
1603
+ "# 获取 HTML文件的绝对路径\n",
1604
+ "file_path = 'file:///' + os.path.abspath('./html/level_locate.html')\n",
1605
+ "print(file_path)\n",
1606
+ "\n",
1607
+ "# 发送 GET请求\n",
1608
+ "chrome.get(file_path)\n",
1609
+ "\n",
1610
+ "# 点击 Link1链接(弹出下拉列表)\n",
1611
+ "chrome.find_element(by=By.LINK_TEXT, value='Link1').click()\n",
1612
+ "\n",
1613
+ "# 找到 id 为 dropdown1的父元素\n",
1614
+ "# WebDriverWait(chrome, 10):10秒内每隔 500毫秒扫描 1次页面变化,当出现指定的元素后结束\n",
1615
+ "WebDriverWait(chrome, 10).until(\n",
1616
+ " lambda the_driver: the_driver.find_element(by=By.ID, value='dropdown1').is_displayed())\n",
1617
+ "\n",
1618
+ "# 在父亲元件下找到link为Action的子元素\n",
1619
+ "menu = chrome.find_element(by=By.ID, value='dropdown1').find_element(by=By.LINK_TEXT,value='Action')\n",
1620
+ "\n",
1621
+ "# 鼠标定位到子元素上\n",
1622
+ "webdriver.ActionChains(chrome).move_to_element(menu).perform()\n",
1623
+ "\n",
1624
+ "time.sleep(2)\n",
1625
+ "chrome.quit()"
1626
+ ]
1627
+ },
1628
+ {
1629
+ "cell_type": "code",
1630
+ "execution_count": 45,
1631
+ "id": "90d13530",
1632
+ "metadata": {
1633
+ "ExecuteTime": {
1634
+ "end_time": "2023-10-26T02:04:31.640554Z",
1635
+ "start_time": "2023-10-26T02:04:10.201492Z"
1636
+ }
1637
+ },
1638
+ "outputs": [],
1639
+ "source": [
1640
+ "\"\"\"定位元素\"\"\"\n",
1641
+ "from selenium import webdriver\n",
1642
+ "from time import sleep\n",
1643
+ "import os\n",
1644
+ "from selenium.webdriver.common.by import By\n",
1645
+ "from selenium.webdriver.common.keys import Keys\n",
1646
+ "\n",
1647
+ "\n",
1648
+ "def test01():\n",
1649
+ "\n",
1650
+ " # 创建 浏览器\n",
1651
+ " chrome = webdriver.Chrome()\n",
1652
+ "\n",
1653
+ " # 发送 GET请求\n",
1654
+ " chrome.get('http://www.baidu.com')\n",
1655
+ " sleep(2)\n",
1656
+ "\n",
1657
+ " # 查找输入框元素,输入 python\n",
1658
+ " chrome.find_element(by=By.ID, value='kw').send_keys('python')\n",
1659
+ " sleep(2)\n",
1660
+ "\n",
1661
+ " # 找到 搜索键,并点击\n",
1662
+ " chrome.find_element(by=By.ID, value='su').click()\n",
1663
+ " sleep(2)\n",
1664
+ "\n",
1665
+ " # 退出浏览器\n",
1666
+ " chrome.quit()\n",
1667
+ "\n",
1668
+ "\n",
1669
+ "def test02():\n",
1670
+ " \n",
1671
+ " # 创建 浏览器\n",
1672
+ " chrome = webdriver.Chrome()\n",
1673
+ "\n",
1674
+ " # 查找 文件绝对路径\n",
1675
+ " file_path = 'file:///'+os.path.abspath('./html/test01.html')\n",
1676
+ " \n",
1677
+ " # 发送 GET请求\n",
1678
+ " chrome.get(file_path)\n",
1679
+ " \n",
1680
+ " # 定位元素,并点击\n",
1681
+ " chrome.find_element(by=By.LINK_TEXT, value='Link1').click()\n",
1682
+ " \n",
1683
+ " # 定位元素\n",
1684
+ " menu = chrome.find_element(by=By.ID, value='dropdown1').find_element(by=By.LINK_TEXT, value='Action')\n",
1685
+ "\n",
1686
+ " # webdriver.ActionChains(chrome).move_to_element(menu).perform() # 移动焦点到某个元素\n",
1687
+ " \n",
1688
+ " # 点击\n",
1689
+ " menu.click()\n",
1690
+ "\n",
1691
+ " sleep(2)\n",
1692
+ " \n",
1693
+ " # 退出浏览器\n",
1694
+ " chrome.quit()\n",
1695
+ "\n",
1696
+ "\n",
1697
+ "if __name__ == '__main__':\n",
1698
+ " test01()\n",
1699
+ " test02()"
1700
+ ]
1701
+ },
1702
+ {
1703
+ "cell_type": "markdown",
1704
+ "id": "722d912b",
1705
+ "metadata": {},
1706
+ "source": [
1707
+ "### 操作元素\n",
1708
+ "\n",
1709
+ "定位元素 只是第一步,定位之后需要对这个 元素 进行操作。\n",
1710
+ "\n",
1711
+ "鼠标点击 还是 键盘输入,这要取决于我们定位的是按钮还输入框。\n",
1712
+ "\n",
1713
+ "一般来说,webdriver 中比较常用的操作对象的方法有下面几个\n",
1714
+ "\n",
1715
+ "- click 点击对象\n",
1716
+ "- send_keys 在对象上模拟按键输入\n",
1717
+ "- clear 清除对象的内容"
1718
+ ]
1719
+ },
1720
+ {
1721
+ "cell_type": "code",
1722
+ "execution_count": 50,
1723
+ "id": "f63b9f19",
1724
+ "metadata": {
1725
+ "ExecuteTime": {
1726
+ "end_time": "2023-10-26T02:11:25.817701Z",
1727
+ "start_time": "2023-10-26T02:11:21.698055Z"
1728
+ }
1729
+ },
1730
+ "outputs": [],
1731
+ "source": [
1732
+ "from selenium import webdriver\n",
1733
+ "from time import sleep\n",
1734
+ "import os\n",
1735
+ "from selenium.webdriver.common.by import By\n",
1736
+ "from selenium.webdriver.common.keys import Keys\n",
1737
+ "\n",
1738
+ "# 创建 浏览器\n",
1739
+ "browser = webdriver.Chrome()\n",
1740
+ "\n",
1741
+ "# 发送 GET请求\n",
1742
+ "browser.get(\"http://www.baidu.com\")\n",
1743
+ "\n",
1744
+ "# 清空内容\n",
1745
+ "browser.find_element(by=By.ID, value=\"kw\").clear()\n",
1746
+ "\n",
1747
+ "# 键盘输入\n",
1748
+ "browser.find_element(by=By.ID, value=\"kw\").send_keys(\"BIT\")\n",
1749
+ "\n",
1750
+ "# 点击\n",
1751
+ "browser.find_element(by=By.ID, value=\"su\").click()\n",
1752
+ "\n",
1753
+ "sleep(2)\n",
1754
+ "\n",
1755
+ "# 退出浏览器\n",
1756
+ "browser.quit()"
1757
+ ]
1758
+ },
1759
+ {
1760
+ "cell_type": "markdown",
1761
+ "id": "063e706d",
1762
+ "metadata": {},
1763
+ "source": [
1764
+ "### 多层窗口的定位\n",
1765
+ "\n",
1766
+ "对于一个现代的web应用,经常会出现框架(frame) 或 窗口(window)的应用,这也就给我们的定位带来了一个难题。\n",
1767
+ "\n",
1768
+ "有时候我们定位一个元素,定位器没有问题,但一直定位不了,这时候就要检查这个元素是否在一个frame中,seelnium webdriver 提供了一个switch_to_frame方法,可以很轻松的来解决这个问题\n",
1769
+ "\n",
1770
+ "多层框架或窗口的定位:\n",
1771
+ "\n",
1772
+ "- switch_to_frame()"
1773
+ ]
1774
+ },
1775
+ {
1776
+ "cell_type": "code",
1777
+ "execution_count": 60,
1778
+ "id": "8ea0892f",
1779
+ "metadata": {
1780
+ "ExecuteTime": {
1781
+ "end_time": "2023-10-26T02:40:45.054799Z",
1782
+ "start_time": "2023-10-26T02:40:39.596725Z"
1783
+ }
1784
+ },
1785
+ "outputs": [],
1786
+ "source": [
1787
+ "from selenium import webdriver\n",
1788
+ "from selenium.webdriver.common.by import By\n",
1789
+ "import time \n",
1790
+ "import os\n",
1791
+ "\n",
1792
+ "# 创建 浏览器\n",
1793
+ "browser = webdriver.Chrome()\n",
1794
+ "\n",
1795
+ "# 获取 文件的绝对路径\n",
1796
+ "file_path = 'file:///' + os.path.abspath('./html/frame.html')\n",
1797
+ "\n",
1798
+ "# 发送 GET请求\n",
1799
+ "browser.get(file_path)\n",
1800
+ "\n",
1801
+ "browser.implicitly_wait(30)\n",
1802
+ "\n",
1803
+ "# 先找到框架(id = f1)\n",
1804
+ "browser.switch_to.frame(\"f1\")\n",
1805
+ "browser.switch_to.frame(\"f2\")\n",
1806
+ "\n",
1807
+ "# 下面开始正常地 查找元素\n",
1808
+ "browser.find_element(by=By.ID, value=\"kw\").send_keys(\"selenium\")\n",
1809
+ "browser.find_element(by=By.ID, value=\"su\").click()\n",
1810
+ "time.sleep(3)\n",
1811
+ "\n",
1812
+ "# 退出浏览器\n",
1813
+ "browser.quit()"
1814
+ ]
1815
+ },
1816
+ {
1817
+ "cell_type": "markdown",
1818
+ "id": "76e59891",
1819
+ "metadata": {},
1820
+ "source": [
1821
+ "### selenium 处理下拉框\n",
1822
+ "\n",
1823
+ "下拉框是我们最常见的一种页面元素,对于一般的元素,我们只需要一次就定位,\n",
1824
+ "\n",
1825
+ "但下拉框里的内容需要进行两次定位,先定位到下拉框,再定位到下拉框内里的选项。"
1826
+ ]
1827
+ },
1828
+ {
1829
+ "cell_type": "code",
1830
+ "execution_count": 62,
1831
+ "id": "69ef3d26",
1832
+ "metadata": {
1833
+ "ExecuteTime": {
1834
+ "end_time": "2023-10-26T02:46:38.389981Z",
1835
+ "start_time": "2023-10-26T02:46:31.821043Z"
1836
+ }
1837
+ },
1838
+ "outputs": [],
1839
+ "source": [
1840
+ "from selenium import webdriver\n",
1841
+ "from selenium.webdriver.common.by import By\n",
1842
+ "import time\n",
1843
+ "import os\n",
1844
+ "\n",
1845
+ "# 创建 浏览器\n",
1846
+ "driver = webdriver.Chrome()\n",
1847
+ "\n",
1848
+ "# 获取文件路径\n",
1849
+ "file_path = 'file:///' + os.path.abspath('./html/drop_down.html')\n",
1850
+ "\n",
1851
+ "# 发送 GET请求\n",
1852
+ "driver.get(file_path)\n",
1853
+ "\n",
1854
+ "time.sleep(2)\n",
1855
+ "\n",
1856
+ "# 定位下拉框元素\n",
1857
+ "m = driver.find_element(by=By.ID, value=\"ShippingMethod\")\n",
1858
+ "\n",
1859
+ "# 定位选项\n",
1860
+ "m.find_element(by=By.XPATH, value=\"//option[@value='10.69']\").click()\n",
1861
+ "time.sleep(3)\n",
1862
+ "\n",
1863
+ "# 退出浏览器\n",
1864
+ "driver.quit()"
1865
+ ]
1866
+ },
1867
+ {
1868
+ "cell_type": "markdown",
1869
+ "id": "93954afe",
1870
+ "metadata": {},
1871
+ "source": [
1872
+ "### selenium 处理弹窗"
1873
+ ]
1874
+ },
1875
+ {
1876
+ "cell_type": "code",
1877
+ "execution_count": 63,
1878
+ "id": "79eabc1d",
1879
+ "metadata": {
1880
+ "ExecuteTime": {
1881
+ "end_time": "2023-10-26T02:50:24.766269Z",
1882
+ "start_time": "2023-10-26T02:50:18.607037Z"
1883
+ }
1884
+ },
1885
+ "outputs": [],
1886
+ "source": [
1887
+ "from selenium import webdriver\n",
1888
+ "import os\n",
1889
+ "from time import sleep\n",
1890
+ "\n",
1891
+ "# 创建 浏览器\n",
1892
+ "chrome = webdriver.Chrome()\n",
1893
+ "\n",
1894
+ "# 获取 文件\n",
1895
+ "file = 'file:///' + os.path.abspath('./html/alter.html')\n",
1896
+ "\n",
1897
+ "# 发送 GET请求\n",
1898
+ "chrome.get(file)\n",
1899
+ "sleep(2)\n",
1900
+ "\n",
1901
+ "# 切换至弹窗,并同意\n",
1902
+ "chrome.switch_to.alert.accept() \n",
1903
+ "sleep(2)\n",
1904
+ "\n",
1905
+ "# 退出浏览器\n",
1906
+ "chrome.quit()"
1907
+ ]
1908
+ },
1909
+ {
1910
+ "cell_type": "markdown",
1911
+ "id": "a2de0d61",
1912
+ "metadata": {},
1913
+ "source": [
1914
+ "### Selenium 调用js方法\n",
1915
+ "\n",
1916
+ "```python\n",
1917
+ "execute_script(script, *args)\n",
1918
+ "```\n",
1919
+ "\n",
1920
+ "有时候我们需要控制页面滚动条上的滚动条,但滚动条 并非页面上的元素,这个时候就需要借助js是来进行操作。\n",
1921
+ "\n",
1922
+ "一般用到操作滚动条的会两个场景:\n",
1923
+ "\n",
1924
+ "1. 要操作的页面元素不在当前页面范围,无法进行操作,需要拖动滚动条\n",
1925
+ "2. 注册时的法律条文 需要阅读,判断用户是否阅读的标准是:滚动条是否拉到最下方。"
1926
+ ]
1927
+ },
1928
+ {
1929
+ "cell_type": "markdown",
1930
+ "id": "98b8df82",
1931
+ "metadata": {},
1932
+ "source": [
1933
+ "**滚动条回到顶部:**\n",
1934
+ "\n",
1935
+ "```python\n",
1936
+ "js=\"var q=document.getElementById('id').scrollTop=0\"\n",
1937
+ "driver.execute_script(js)\n",
1938
+ "```\n",
1939
+ "\n",
1940
+ "**滚动条拉到底部:**\n",
1941
+ "\n",
1942
+ "```python\n",
1943
+ "js=\"var q=document.documentElement.scrollTop=10000\"\n",
1944
+ "driver.execute_script(js)\n",
1945
+ "```\n",
1946
+ "\n",
1947
+ "可以修改scrollTop 的值,来定位右侧滚动条的位置,0是最上面,10000是最底部\n",
1948
+ "\n",
1949
+ "以上方法在Firefox和IE浏览器上是可以的,但是用Chrome浏览器,发现不管用。Chrome浏览器解决办法:\n",
1950
+ "\n",
1951
+ "```python\n",
1952
+ "js = \"var q=document.body.scrollTop=0\"\n",
1953
+ "driver.execute_script(js)\n",
1954
+ "```\n",
1955
+ "\n",
1956
+ "**横向滚动条:**\n",
1957
+ "\n",
1958
+ "```python\n",
1959
+ "js = \"window.scrollTo(100,400)\"\n",
1960
+ "driver.execute_script(js)\n",
1961
+ "```"
1962
+ ]
1963
+ },
1964
+ {
1965
+ "cell_type": "code",
1966
+ "execution_count": 67,
1967
+ "id": "dcd5ffd6",
1968
+ "metadata": {
1969
+ "ExecuteTime": {
1970
+ "end_time": "2023-10-26T03:00:35.385171Z",
1971
+ "start_time": "2023-10-26T03:00:23.251469Z"
1972
+ }
1973
+ },
1974
+ "outputs": [
1975
+ {
1976
+ "name": "stdout",
1977
+ "output_type": "stream",
1978
+ "text": [
1979
+ "30\n"
1980
+ ]
1981
+ }
1982
+ ],
1983
+ "source": [
1984
+ "from selenium import webdriver\n",
1985
+ "from lxml import etree\n",
1986
+ "import time\n",
1987
+ "\n",
1988
+ "# 加载浏览器\n",
1989
+ "wd = webdriver.Chrome()\n",
1990
+ "\n",
1991
+ "# 发送 GET请求\n",
1992
+ "url = \"https://search.jd.com/Search?keyword=%E7%AC%94%E8%AE%B0%E6%9C%AC&enc=utf-8&wq=%E7%AC%94%E8%AE%B0%E6%9C%AC&pvid=845d019c94f6476ca5c4ffc24df6865a\"\n",
1993
+ "wd.get(url)\n",
1994
+ "time.sleep(3)\n",
1995
+ "\n",
1996
+ "# 要执行的 js\n",
1997
+ "js = \"var q = document.documentElement.scrollTop=10000\"\n",
1998
+ "# 执行js\n",
1999
+ "wd.execute_script(js)\n",
2000
+ "\n",
2001
+ "time.sleep(3)\n",
2002
+ "\n",
2003
+ "# 解析 HTML数据\n",
2004
+ "e = etree.HTML(wd.page_source)\n",
2005
+ "\n",
2006
+ "# 提取数据的 xpath\n",
2007
+ "price_xpath = '//ul[@class=\"gl-warp clearfix\"]//div[@class=\"p-price\"]/strong/i/text()'\n",
2008
+ "\n",
2009
+ "# 提取数据\n",
2010
+ "infos = e.xpath(price_xpath)\n",
2011
+ "\n",
2012
+ "print(len(infos))\n",
2013
+ "time.sleep(3)\n",
2014
+ "\n",
2015
+ "# 关闭浏览器\n",
2016
+ "wd.quit()"
2017
+ ]
2018
+ },
2019
+ {
2020
+ "cell_type": "markdown",
2021
+ "id": "2651775b",
2022
+ "metadata": {},
2023
+ "source": [
2024
+ "### selenium 等待处理\n",
2025
+ "\n",
2026
+ "**强制等待:**\n",
2027
+ "\n",
2028
+ "> 使用 time.sleep\n",
2029
+ "\n",
2030
+ "作用:\n",
2031
+ "\n",
2032
+ "当代码运行到强制等待这一行的时候,无论出于什么原因,都强制等待指定的时间,需要通过time模块实现\n",
2033
+ "\n",
2034
+ "优点:简单\n",
2035
+ "\n",
2036
+ "缺点:无法做有效的判断,会浪费时间\n",
2037
+ "\n",
2038
+ "**隐式等待:**\n",
2039
+ "\n",
2040
+ "> 到了一定的时间发现元素还没有加载,则继续等待我们指定的时间,如果超过了我们指定的时间还没有加载就会抛出异常,如果没有需要等待的时候就已经加载完毕,就会立即执行\n",
2041
+ "\n",
2042
+ "优点: 设置一次即可\n",
2043
+ "\n",
2044
+ "缺点:必须等待加载完成才能到后续的操作,或者等待超时才能进入后续的操作\n"
2045
+ ]
2046
+ },
2047
+ {
2048
+ "cell_type": "code",
2049
+ "execution_count": 70,
2050
+ "id": "010d078c",
2051
+ "metadata": {
2052
+ "ExecuteTime": {
2053
+ "end_time": "2023-10-26T03:09:22.651200Z",
2054
+ "start_time": "2023-10-26T03:09:17.678442Z"
2055
+ }
2056
+ },
2057
+ "outputs": [
2058
+ {
2059
+ "name": "stdout",
2060
+ "output_type": "stream",
2061
+ "text": [
2062
+ "<html style=\"--bubble-width: 108px; --bubble-padding-left: 132px;\"><head><meta http-equiv=\"Content-T\n"
2063
+ ]
2064
+ }
2065
+ ],
2066
+ "source": [
2067
+ "from selenium import webdriver\n",
2068
+ "import time\n",
2069
+ "\n",
2070
+ "\n",
2071
+ "# 创建 浏览器\n",
2072
+ "driver = webdriver.Chrome()\n",
2073
+ "\n",
2074
+ "# 发送 GET请求\n",
2075
+ "url = 'https://www.baidu.com/'\n",
2076
+ "driver.get(url)\n",
2077
+ "\n",
2078
+ "# 隐式等待:如果查找到我们要的数据,则不再等待\n",
2079
+ "driver.implicitly_wait(3)\n",
2080
+ "\n",
2081
+ "try:\n",
2082
+ " # 查找元素\n",
2083
+ " print(driver.find_element(by=By.CLASS_NAME, value='next'))\n",
2084
+ "except:\n",
2085
+ " pass\n",
2086
+ "\n",
2087
+ "# 打印 源代码\n",
2088
+ "print(driver.page_source[:100])\n",
2089
+ "\n",
2090
+ "driver.quit()"
2091
+ ]
2092
+ },
2093
+ {
2094
+ "cell_type": "markdown",
2095
+ "id": "e2eed012",
2096
+ "metadata": {},
2097
+ "source": [
2098
+ "\n",
2099
+ "**显示等待:**\n",
2100
+ "\n",
2101
+ "> 指定一个等待条件,并且指定一个最长等待时间,会在这个时间内进行判断是否满足等待条件,如果成立就会立即返回,如果不成立,就会一直等待,直到等待你指定的最长等待时间,如果还是不满足,就会抛出异常,如果满足了就会正常返回\n",
2102
+ "\n",
2103
+ "优点:专门用于对指定一个元素等待,加载完即可运行后续代码\n",
2104
+ "\n",
2105
+ "缺点:多个元素都需要要单独设置等待\n"
2106
+ ]
2107
+ },
2108
+ {
2109
+ "cell_type": "code",
2110
+ "execution_count": 72,
2111
+ "id": "7e843c34",
2112
+ "metadata": {
2113
+ "ExecuteTime": {
2114
+ "end_time": "2023-10-26T03:12:26.751618Z",
2115
+ "start_time": "2023-10-26T03:12:21.792997Z"
2116
+ }
2117
+ },
2118
+ "outputs": [
2119
+ {
2120
+ "name": "stdout",
2121
+ "output_type": "stream",
2122
+ "text": [
2123
+ "元素获取失败\n",
2124
+ "<html lang=\"en\" data-n-head=\"%7B%22lang%22:%7B%22ssr%22:%22en%22%7D%7D\" class=\"webp\"><head>\n",
2125
+ " <tit\n"
2126
+ ]
2127
+ }
2128
+ ],
2129
+ "source": [
2130
+ "from selenium import webdriver\n",
2131
+ "import time\n",
2132
+ "\n",
2133
+ "# 创建 浏览器\n",
2134
+ "driver = webdriver.Chrome()\n",
2135
+ "\n",
2136
+ "# 发送 GET请求\n",
2137
+ "url = 'https://www.guazi.com/nj/buy/'\n",
2138
+ "driver.get(url)\n",
2139
+ "\n",
2140
+ "# 显示等待\n",
2141
+ "wait = WebDriverWait(driver, 10, 0.5)\n",
2142
+ "\n",
2143
+ "try:\n",
2144
+ " wait.until(EC.presence_of_element_located((By.CLASS_NAME, 'next')))\n",
2145
+ " \n",
2146
+ "except:\n",
2147
+ " print('元素获取失败')\n",
2148
+ " \n",
2149
+ "print(driver.page_source[:100])\n",
2150
+ "\n",
2151
+ "driver.quit()"
2152
+ ]
2153
+ },
2154
+ {
2155
+ "cell_type": "code",
2156
+ "execution_count": 78,
2157
+ "id": "80b1b81a",
2158
+ "metadata": {
2159
+ "ExecuteTime": {
2160
+ "end_time": "2023-10-26T03:21:17.778201Z",
2161
+ "start_time": "2023-10-26T03:21:05.089952Z"
2162
+ }
2163
+ },
2164
+ "outputs": [
2165
+ {
2166
+ "name": "stdout",
2167
+ "output_type": "stream",
2168
+ "text": [
2169
+ "test01 查找指定元素失败!\n",
2170
+ "test02 查找指定元素失败!\n",
2171
+ "test03 查找指定元素失败!\n"
2172
+ ]
2173
+ }
2174
+ ],
2175
+ "source": [
2176
+ "\"\"\"处理等待的代码\"\"\"\n",
2177
+ "from selenium import webdriver\n",
2178
+ "from time import sleep\n",
2179
+ "from selenium.webdriver.support.wait import WebDriverWait\n",
2180
+ "\n",
2181
+ "\n",
2182
+ "def test01():\n",
2183
+ " \n",
2184
+ " # 创建 浏览器\n",
2185
+ " chrome = webdriver.Chrome()\n",
2186
+ " \n",
2187
+ " # 发送 GET请求\n",
2188
+ " chrome.get('https://search.jd.com/Search?keyword=imac&enc=utf-8&wq=imac')\n",
2189
+ "\n",
2190
+ " # 执行JS代码 -- 拉动下拉框\n",
2191
+ " js = 'document.documentElement.scrollTop=10000'\n",
2192
+ " chrome.execute_script(js)\n",
2193
+ " \n",
2194
+ " # 隐式等待\n",
2195
+ " chrome.implicitly_wait(2)\n",
2196
+ " \n",
2197
+ " try:\n",
2198
+ " # 查找元素\n",
2199
+ " info = chrome.find_elements_by_xpath('//div[@class=\"p-name p-name-type-2\"]/a/em')\n",
2200
+ " print('test01 查找指定元素成功!')\n",
2201
+ " except:\n",
2202
+ " print('test01 查找指定元素失败!')\n",
2203
+ " \n",
2204
+ " chrome.quit()\n",
2205
+ "\n",
2206
+ "\n",
2207
+ "def test02():\n",
2208
+ " \n",
2209
+ " # 创建浏览器对象\n",
2210
+ " chrome = webdriver.Chrome()\n",
2211
+ " \n",
2212
+ " # 发送 GET请求\n",
2213
+ " chrome.get('http://www.baidu.com/')\n",
2214
+ " \n",
2215
+ " # 找到搜索栏,键盘录入\n",
2216
+ " chrome.find_element(by=By.ID, value='kw').send_keys('离岸金融')\n",
2217
+ " \n",
2218
+ " # 点击查询\n",
2219
+ " chrome.find_element(by=By.ID, value='su').click()\n",
2220
+ " \n",
2221
+ " # 隐式等待\n",
2222
+ " chrome.implicitly_wait(2)\n",
2223
+ " \n",
2224
+ " try:\n",
2225
+ " # 查找元素\n",
2226
+ " chrome.find_element_by_xpath('//div[@id=\"1\"]/h3/a').click()\n",
2227
+ " print('test02 查找指定元素成功!')\n",
2228
+ " except:\n",
2229
+ " print('test02 查找指定元素失败!')\n",
2230
+ " \n",
2231
+ " # 强制等待\n",
2232
+ " sleep(3)\n",
2233
+ " \n",
2234
+ " # 退出浏览器\n",
2235
+ " chrome.quit()\n",
2236
+ "\n",
2237
+ "\n",
2238
+ "def test03():\n",
2239
+ " \n",
2240
+ " # 创建 浏览器对象\n",
2241
+ " chrome = webdriver.Chrome()\n",
2242
+ " \n",
2243
+ " # 发送 GET请求\n",
2244
+ " chrome.get('http://www.baidu.com/')\n",
2245
+ " \n",
2246
+ " # 找到搜索栏,键盘录入\n",
2247
+ " chrome.find_element(by=By.ID, value='kw').send_keys('离岸金融')\n",
2248
+ " \n",
2249
+ " # 点击查询\n",
2250
+ " chrome.find_element(by=By.ID, value='su').click()\n",
2251
+ " \n",
2252
+ " try:\n",
2253
+ " # 查找元素\n",
2254
+ " chrome.find_element_by_xpath('//div[@id=\"1\"]/h3/a').click()\n",
2255
+ " print('test03 查找指定元素成功!')\n",
2256
+ " except:\n",
2257
+ " print('test03 查找指定元素失败!')\n",
2258
+ "\n",
2259
+ " # 强制等待\n",
2260
+ " sleep(3)\n",
2261
+ " \n",
2262
+ " # 退出浏览器\n",
2263
+ " chrome.quit()\n",
2264
+ "\n",
2265
+ "\n",
2266
+ "if __name__ == '__main__':\n",
2267
+ " test01()\n",
2268
+ " test02()\n",
2269
+ " test03()"
2270
+ ]
2271
+ },
2272
+ {
2273
+ "cell_type": "markdown",
2274
+ "id": "cf766ff2",
2275
+ "metadata": {},
2276
+ "source": [
2277
+ "### 元素拖拽\n",
2278
+ "\n",
2279
+ "> 要完成元素的拖拽,首先你需要指定被拖动的元素和拖动目标元素,然后利用 ActionChains 类来实现"
2280
+ ]
2281
+ },
2282
+ {
2283
+ "cell_type": "code",
2284
+ "execution_count": 80,
2285
+ "id": "3d6128cd",
2286
+ "metadata": {
2287
+ "ExecuteTime": {
2288
+ "end_time": "2023-10-26T03:29:33.920415Z",
2289
+ "start_time": "2023-10-26T03:29:09.189530Z"
2290
+ }
2291
+ },
2292
+ "outputs": [],
2293
+ "source": [
2294
+ "from time import sleep\n",
2295
+ "from selenium.webdriver import ActionChains\n",
2296
+ "import os\n",
2297
+ "\n",
2298
+ "# 创建 浏览器\n",
2299
+ "chrome = webdriver.Chrome()\n",
2300
+ "\n",
2301
+ "# 发送 GET请求\n",
2302
+ "chrome.get(f'file:///{os.path.abspath(\"./html/scroll.html\")}')\n",
2303
+ "\n",
2304
+ "# 查找元素\n",
2305
+ "div1 = chrome.find_element(by=By.ID, value='draggable')\n",
2306
+ "div2 = chrome.find_element(by=By.ID, value='draggable2')\n",
2307
+ "div3 = chrome.find_element(by=By.ID, value='draggable3')\n",
2308
+ "\n",
2309
+ "# 强制暂停\n",
2310
+ "sleep(2)\n",
2311
+ "\n",
2312
+ "# 创建 ActionChains\n",
2313
+ "action_chains = ActionChains(chrome)\n",
2314
+ "\n",
2315
+ "# 将 div1元素 拖拽至 div2\n",
2316
+ "action_chains.drag_and_drop(div1, div2).perform()\n",
2317
+ "\n",
2318
+ "# 将 div3,向右下拖动10个像素,共拖动 5次\n",
2319
+ "a = action_chains.drag_and_drop_by_offset(div3, 10, 10) # 定义动作\n",
2320
+ "\n",
2321
+ "# 循环执行动作\n",
2322
+ "for i in range(5):\n",
2323
+ " a.perform() \n",
2324
+ " sleep(2)\n",
2325
+ " \n",
2326
+ "chrome.quit()"
2327
+ ]
2328
+ },
2329
+ {
2330
+ "cell_type": "markdown",
2331
+ "id": "eaa2a9df",
2332
+ "metadata": {},
2333
+ "source": [
2334
+ "### 参数的使用"
2335
+ ]
2336
+ },
2337
+ {
2338
+ "cell_type": "code",
2339
+ "execution_count": 84,
2340
+ "id": "a68bd004",
2341
+ "metadata": {
2342
+ "ExecuteTime": {
2343
+ "end_time": "2023-10-26T03:44:15.450356Z",
2344
+ "start_time": "2023-10-26T03:43:56.750420Z"
2345
+ }
2346
+ },
2347
+ "outputs": [
2348
+ {
2349
+ "name": "stdout",
2350
+ "output_type": "stream",
2351
+ "text": [
2352
+ "<html><head><script type=\"text/javascript\" charset=\"utf-8\" src=\"https://pss.bdstatic.com/static/supe\n",
2353
+ "<html dir=\"ltr\" lang=\"zh\"><head>\n",
2354
+ " <meta charset=\"utf-8\">\n",
2355
+ " <meta name=\"color-scheme\" content=\"light\n",
2356
+ "<html><head><script type=\"text/javascript\" charset=\"utf-8\" src=\"https://pss.bdstatic.com/static/supe\n"
2357
+ ]
2358
+ }
2359
+ ],
2360
+ "source": [
2361
+ "from selenium import webdriver\n",
2362
+ "import time\n",
2363
+ "\n",
2364
+ "def headless():\n",
2365
+ " \"\"\"无头模式\"\"\"\n",
2366
+ " \n",
2367
+ " # 设置成无头浏览器\n",
2368
+ " options = webdriver.ChromeOptions()\n",
2369
+ " options.add_argument('--headless')\n",
2370
+ "\n",
2371
+ " # 创建 浏览器\n",
2372
+ " chrome = webdriver.Chrome(options=options)\n",
2373
+ " \n",
2374
+ " # 发送 GET请求\n",
2375
+ " chrome.get('http://www.baidu.com/')\n",
2376
+ " \n",
2377
+ " # 打印 源码\n",
2378
+ " print(chrome.page_source[:100])\n",
2379
+ " \n",
2380
+ " time.sleep(2)\n",
2381
+ " \n",
2382
+ " # 退出浏览器\n",
2383
+ " chrome.quit()\n",
2384
+ "\n",
2385
+ "\n",
2386
+ "def proxy():\n",
2387
+ " \"\"\"代理模式\"\"\"\n",
2388
+ " \n",
2389
+ " # 设置代理\n",
2390
+ " options = webdriver.ChromeOptions()\n",
2391
+ " \n",
2392
+ " # options.add_argument('--proxy-server=type://ip:port')\n",
2393
+ " options.add_argument('--proxy-server=http://113.238.142.208:3128')\n",
2394
+ "\n",
2395
+ " # 创建 浏览器\n",
2396
+ " chrome = webdriver.Chrome(options=options)\n",
2397
+ " \n",
2398
+ " # 发送 GET请求\n",
2399
+ " chrome.get('http://httpbin.org/get')\n",
2400
+ " \n",
2401
+ " # 打印 源代码\n",
2402
+ " print(chrome.page_source[:100])\n",
2403
+ " time.sleep(2)\n",
2404
+ " \n",
2405
+ " # 退出浏览器\n",
2406
+ " chrome.quit()\n",
2407
+ "\n",
2408
+ "\n",
2409
+ "def jiance():\n",
2410
+ " \"\"\"防检测设置\"\"\"\n",
2411
+ " \n",
2412
+ " # 设置防检测\n",
2413
+ " options = webdriver.ChromeOptions()\n",
2414
+ " options.add_experimental_option('excludeSwitches', ['enable-automation'])\n",
2415
+ " options.add_experimental_option('useAutomationExtension', False)\n",
2416
+ "\n",
2417
+ " # 创建 浏览器\n",
2418
+ " chrome = webdriver.Chrome()\n",
2419
+ "\n",
2420
+ " chrome.execute_cdp_cmd(\"Page.addScriptToEvaluateOnNewDocument\", {\n",
2421
+ " \"source\": \"\"\"\n",
2422
+ " Object.defineProperty(navigator, 'webdriver', {\n",
2423
+ " get: () => false\n",
2424
+ " })\n",
2425
+ " \"\"\"\n",
2426
+ " })\n",
2427
+ "\n",
2428
+ " # 发送 GET请求\n",
2429
+ " chrome.get('http://www.baidu.com/')\n",
2430
+ " \n",
2431
+ " # 打印 源代码\n",
2432
+ " print(chrome.page_source[:100])\n",
2433
+ " time.sleep(2)\n",
2434
+ " \n",
2435
+ " # 退出浏览器\n",
2436
+ " chrome.quit()\n",
2437
+ "\n",
2438
+ "if __name__ == '__main__':\n",
2439
+ " headless()\n",
2440
+ " proxy()\n",
2441
+ " jiance()"
2442
+ ]
2443
+ },
2444
+ {
2445
+ "cell_type": "markdown",
2446
+ "id": "d1f442c4",
2447
+ "metadata": {},
2448
+ "source": [
2449
+ "## Selenium案例"
2450
+ ]
2451
+ },
2452
+ {
2453
+ "cell_type": "code",
2454
+ "execution_count": 88,
2455
+ "id": "bcfe0f40",
2456
+ "metadata": {
2457
+ "ExecuteTime": {
2458
+ "end_time": "2023-10-26T03:50:53.590462Z",
2459
+ "start_time": "2023-10-26T03:50:48.959878Z"
2460
+ }
2461
+ },
2462
+ "outputs": [
2463
+ {
2464
+ "name": "stdout",
2465
+ "output_type": "stream",
2466
+ "text": [
2467
+ "=========第1页数据==========\n",
2468
+ "120\n",
2469
+ "120\n",
2470
+ "120\n"
2471
+ ]
2472
+ }
2473
+ ],
2474
+ "source": [
2475
+ "\"\"\"遍历虎牙直播的各个页面\"\"\"\n",
2476
+ "from selenium import webdriver\n",
2477
+ "from lxml import etree\n",
2478
+ "\n",
2479
+ "# 创建浏览器\n",
2480
+ "chrome = webdriver.Chrome()\n",
2481
+ "\n",
2482
+ "# 发送 GET请求\n",
2483
+ "chrome.get('https://www.huya.com/g/lol')\n",
2484
+ "\n",
2485
+ "# 隐式等待\n",
2486
+ "chrome.implicitly_wait(10)\n",
2487
+ "\n",
2488
+ "i = 0\n",
2489
+ "while True:\n",
2490
+ " \n",
2491
+ " # 解析 HTML\n",
2492
+ " e = etree.HTML(chrome.page_source)\n",
2493
+ " \n",
2494
+ " # 1. 使用浏览器的查找元素获取 标签,再获取里面内容\n",
2495
+ " rooms = chrome.find_elements(by=By.CLASS_NAME, value='title') \n",
2496
+ " names = chrome.find_elements(by=By.CLASS_NAME, value='nick')\n",
2497
+ " counts = chrome.find_elements(by=By.CLASS_NAME, value='js-num')\n",
2498
+ "\n",
2499
+ " # 2. 直接使用源码,通过源码再用xpath提取 \n",
2500
+ " rooms = e.xpath('//a[@class=\"title\"]/text()')\n",
2501
+ " names = e.xpath('//i[@class=\"nick\"]/text()')\n",
2502
+ " counts = e.xpath('//i[@class=\"js-num\"]/text()')\n",
2503
+ " \n",
2504
+ " print(f'=========第{i+1}页数据==========')\n",
2505
+ " print(len(rooms))\n",
2506
+ " print(len(names))\n",
2507
+ " print(len(counts))\n",
2508
+ " \n",
2509
+ " # 查找元素\n",
2510
+ " has_next = chrome.page_source.find('laypage_next')\n",
2511
+ " \n",
2512
+ " # 如果找到\n",
2513
+ " if has_next != -1:\n",
2514
+ " try:\n",
2515
+ " chrome.find_element(by=By.CLASS_NAME, value='laypage_next').click()\n",
2516
+ " except:\n",
2517
+ " break\n",
2518
+ " else:\n",
2519
+ " break\n",
2520
+ " \n",
2521
+ " i += 1\n",
2522
+ " \n",
2523
+ "# 退出浏览器\n",
2524
+ "chrome.quit()\n"
2525
+ ]
2526
+ },
2527
+ {
2528
+ "cell_type": "code",
2529
+ "execution_count": 95,
2530
+ "id": "f9dee889",
2531
+ "metadata": {
2532
+ "ExecuteTime": {
2533
+ "end_time": "2023-10-26T04:06:56.864130Z",
2534
+ "start_time": "2023-10-26T04:06:50.733021Z"
2535
+ }
2536
+ },
2537
+ "outputs": [
2538
+ {
2539
+ "name": "stdout",
2540
+ "output_type": "stream",
2541
+ "text": [
2542
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtm\n"
2543
+ ]
2544
+ }
2545
+ ],
2546
+ "source": [
2547
+ "\"\"\"验证码登录1\"\"\"\n",
2548
+ "import requests\n",
2549
+ "import time\n",
2550
+ "\n",
2551
+ "\n",
2552
+ "def login_input():\n",
2553
+ " \"\"\"输入验证码进行登录\"\"\"\n",
2554
+ " \n",
2555
+ " # 设置请求头\n",
2556
+ " headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'}\n",
2557
+ "\n",
2558
+ " login_url = 'http://www.chaojiying.com/user/login/'\n",
2559
+ " \n",
2560
+ " # 生成验证码的 URL\n",
2561
+ " img_url = 'http://www.chaojiying.com/include/code/code.php?u=1'\n",
2562
+ " \n",
2563
+ " # 发送 GET请求\n",
2564
+ " session = requests.Session()\n",
2565
+ " img_resp = session.get(img_url, headers=headers)\n",
2566
+ " \n",
2567
+ " \n",
2568
+ " # 读取网址中的 验证码图片,并保存在本地\n",
2569
+ " with open('./data/tmp.png', 'wb') as f:\n",
2570
+ " f.write(img_resp.content)\n",
2571
+ "\n",
2572
+ " code = input('请输入验证码:')\n",
2573
+ " \n",
2574
+ " # 设置参数\n",
2575
+ " params = {\n",
2576
+ " 'user': 'feelingslw',\n",
2577
+ " 'pass': '123456',\n",
2578
+ " 'imgtxt': code,\n",
2579
+ " 'act': '1'\n",
2580
+ " }\n",
2581
+ "\n",
2582
+ " # 发送 POST请求\n",
2583
+ " resp = session.post(login_url, data=params, headers=headers)\n",
2584
+ " \n",
2585
+ " # 获取网页内容\n",
2586
+ " print(resp.text[:100])\n",
2587
+ "\n",
2588
+ "\n",
2589
+ "def login_auto():\n",
2590
+ " \"\"\"自动化登录\"\"\"\n",
2591
+ " from data.chaojiying_Python.chaojiying import get_code\n",
2592
+ " \n",
2593
+ " # 设置请求头\n",
2594
+ " headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'}\n",
2595
+ " \n",
2596
+ " # 创建 session对象\n",
2597
+ " session = requests.Session()\n",
2598
+ "\n",
2599
+ " login_url = 'http://www.chaojiying.com/user/login/'\n",
2600
+ " img_url = 'http://www.chaojiying.com/include/code/code.php?u=1'\n",
2601
+ "\n",
2602
+ " # 发送 GET请求,获取验证码图片\n",
2603
+ " img_resp = session.get(img_url, headers=headers)\n",
2604
+ " \n",
2605
+ " # 读取网址中的 验证码图片,并保存在本地\n",
2606
+ " with open('./data/tmp.png', 'wb') as f:\n",
2607
+ " f.write(img_resp.content)\n",
2608
+ "\n",
2609
+ " # 提取验证码\n",
2610
+ " code = get_code('./data/tmp.png')\n",
2611
+ " \n",
2612
+ " # 设置参数\n",
2613
+ " params = {\n",
2614
+ " 'user': 'feelingslw',\n",
2615
+ " 'pass': '123456',\n",
2616
+ " 'imgtxt': code,\n",
2617
+ " 'act': '1'\n",
2618
+ " }\n",
2619
+ "\n",
2620
+ " # 发送 POST请求\n",
2621
+ " resp = session.post(login_url, data=params, headers=headers)\n",
2622
+ " print(resp.text[:100])\n",
2623
+ "\n",
2624
+ "\n",
2625
+ "if __name__ == \"__main__\":\n",
2626
+ " login_auto()"
2627
+ ]
2628
+ },
2629
+ {
2630
+ "cell_type": "code",
2631
+ "execution_count": 98,
2632
+ "id": "46707776",
2633
+ "metadata": {
2634
+ "ExecuteTime": {
2635
+ "end_time": "2023-10-26T04:10:46.342475Z",
2636
+ "start_time": "2023-10-26T04:10:46.132352Z"
2637
+ }
2638
+ },
2639
+ "outputs": [
2640
+ {
2641
+ "name": "stdout",
2642
+ "output_type": "stream",
2643
+ "text": [
2644
+ "[]\n",
2645
+ "<!DOCTYPE html>\n",
2646
+ "<html lang=\"en\">\n",
2647
+ " <head>\n",
2648
+ " <meta charset=\"UTF-8\" />\n",
2649
+ " <meta http-equiv=\"X-UA-Co\n"
2650
+ ]
2651
+ }
2652
+ ],
2653
+ "source": [
2654
+ "\"\"\"验证码登录2\"\"\"\n",
2655
+ "import requests\n",
2656
+ "from data.chaojiying_Python.chaojiying import get_code\n",
2657
+ "from re import findall\n",
2658
+ "\n",
2659
+ "login_url = 'https://passport.ganji.com/login.php'\n",
2660
+ "img_url = 'https://passport.ganji.com/ajax.php?dir=captcha&module=login_captcha'\n",
2661
+ "\n",
2662
+ "# 设置请求头\n",
2663
+ "headers = {\n",
2664
+ " 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'}\n",
2665
+ "\n",
2666
+ "\n",
2667
+ "# 发送 GET请求,打开登录页面\n",
2668
+ "session = requests.Session()\n",
2669
+ "login_html = session.get(login_url, headers=headers)\n",
2670
+ "\n",
2671
+ "# 提取 hash\n",
2672
+ "hash = findall('\"__hash__\":\"(.+?)\"', login_html.text)\n",
2673
+ "\n",
2674
+ "# 发送 GET请求,获取验证码\n",
2675
+ "img_resp = session.get(img_url, headers=headers)\n",
2676
+ "\n",
2677
+ "# 读取验证码图片\n",
2678
+ "with open('./data/tmp.png', 'wb') as f:\n",
2679
+ " f.write(img_resp.content)\n",
2680
+ "\n",
2681
+ "# 识别验证码\n",
2682
+ "code = get_code('./data/tmp.png')\n",
2683
+ "\n",
2684
+ "# 构造登录参数\n",
2685
+ "data = {\n",
2686
+ " \"username\": \"17703181473\",\n",
2687
+ " \"password\": \"123456qwe\",\n",
2688
+ " \"setcookie\": \"0\",\n",
2689
+ " \"checkCode\": code,\n",
2690
+ " \"next\": \"/\",\n",
2691
+ " \"source\": \"passport\",\n",
2692
+ " \"__hash__\": hash,\n",
2693
+ "}\n",
2694
+ "\n",
2695
+ "# 发送 POST请求,进行登录\n",
2696
+ "login_resp = session.post(login_url, headers=headers, data=data)\n",
2697
+ "\n",
2698
+ "# 打印结果\n",
2699
+ "print(login_resp.text[:100])"
2700
+ ]
2701
+ },
2702
+ {
2703
+ "cell_type": "code",
2704
+ "execution_count": null,
2705
+ "id": "c8d892c2",
2706
+ "metadata": {},
2707
+ "outputs": [],
2708
+ "source": []
2709
+ },
2710
+ {
2711
+ "cell_type": "code",
2712
+ "execution_count": null,
2713
+ "id": "54e7051b",
2714
+ "metadata": {},
2715
+ "outputs": [],
2716
+ "source": []
2717
+ },
2718
+ {
2719
+ "cell_type": "code",
2720
+ "execution_count": null,
2721
+ "id": "8cd6362f",
2722
+ "metadata": {},
2723
+ "outputs": [],
2724
+ "source": []
2725
+ }
2726
+ ],
2727
+ "metadata": {
2728
+ "kernelspec": {
2729
+ "display_name": "Python 3 (ipykernel)",
2730
+ "language": "python",
2731
+ "name": "python3"
2732
+ },
2733
+ "language_info": {
2734
+ "codemirror_mode": {
2735
+ "name": "ipython",
2736
+ "version": 3
2737
+ },
2738
+ "file_extension": ".py",
2739
+ "mimetype": "text/x-python",
2740
+ "name": "python",
2741
+ "nbconvert_exporter": "python",
2742
+ "pygments_lexer": "ipython3",
2743
+ "version": "3.9.12"
2744
+ },
2745
+ "toc": {
2746
+ "base_numbering": 1,
2747
+ "nav_menu": {},
2748
+ "number_sections": true,
2749
+ "sideBar": true,
2750
+ "skip_h1_title": false,
2751
+ "title_cell": "Table of Contents",
2752
+ "title_sidebar": "Contents",
2753
+ "toc_cell": false,
2754
+ "toc_position": {
2755
+ "height": "calc(100% - 180px)",
2756
+ "left": "10px",
2757
+ "top": "150px",
2758
+ "width": "288px"
2759
+ },
2760
+ "toc_section_display": true,
2761
+ "toc_window_display": true
2762
+ }
2763
+ },
2764
+ "nbformat": 4,
2765
+ "nbformat_minor": 5
2766
+ }
03_Scrapy框架.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
04_MongoDB数据库.ipynb ADDED
@@ -0,0 +1,1009 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "b8aed906",
6
+ "metadata": {},
7
+ "source": [
8
+ "## 启动 MongoDB"
9
+ ]
10
+ },
11
+ {
12
+ "cell_type": "code",
13
+ "execution_count": 6,
14
+ "id": "5fdbf81c",
15
+ "metadata": {
16
+ "ExecuteTime": {
17
+ "end_time": "2023-10-31T02:30:00.385568Z",
18
+ "start_time": "2023-10-31T02:27:45.121736Z"
19
+ },
20
+ "scrolled": true
21
+ },
22
+ "outputs": [
23
+ {
24
+ "name": "stdout",
25
+ "output_type": "stream",
26
+ "text": [
27
+ "/Users/macbook/opt/mongodb/bin\n",
28
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.517+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":4915701, \"ctx\":\"thread1\",\"msg\":\"Initialized wire specification\",\"attr\":{\"spec\":{\"incomingExternalClient\":{\"minWireVersion\":0,\"maxWireVersion\":21},\"incomingInternalClient\":{\"minWireVersion\":0,\"maxWireVersion\":21},\"outgoing\":{\"minWireVersion\":6,\"maxWireVersion\":21},\"isInternalClient\":true}}}\n",
29
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.521+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":23285, \"ctx\":\"thread1\",\"msg\":\"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'\"}\n",
30
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.523+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":4648602, \"ctx\":\"thread1\",\"msg\":\"Implicit TCP FastOpen in use.\"}\n",
31
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.531+08:00\"},\"s\":\"I\", \"c\":\"REPL\", \"id\":5123008, \"ctx\":\"thread1\",\"msg\":\"Successfully registered PrimaryOnlyService\",\"attr\":{\"service\":\"TenantMigrationDonorService\",\"namespace\":\"config.tenantMigrationDonors\"}}\n",
32
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.532+08:00\"},\"s\":\"I\", \"c\":\"REPL\", \"id\":5123008, \"ctx\":\"thread1\",\"msg\":\"Successfully registered PrimaryOnlyService\",\"attr\":{\"service\":\"TenantMigrationRecipientService\",\"namespace\":\"config.tenantMigrationRecipients\"}}\n",
33
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.532+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":5945603, \"ctx\":\"thread1\",\"msg\":\"Multi threading initialized\"}\n",
34
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.532+08:00\"},\"s\":\"I\", \"c\":\"TENANT_M\", \"id\":7091600, \"ctx\":\"thread1\",\"msg\":\"Starting TenantMigrationAccessBlockerRegistry\"}\n",
35
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.532+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":4615611, \"ctx\":\"initandlisten\",\"msg\":\"MongoDB starting\",\"attr\":{\"pid\":87139,\"port\":27017,\"dbPath\":\"../data\",\"architecture\":\"64-bit\",\"host\":\"macbookdeMacBook-Air.local\"}}\n",
36
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.532+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":23403, \"ctx\":\"initandlisten\",\"msg\":\"Build Info\",\"attr\":{\"buildInfo\":{\"version\":\"7.0.2\",\"gitVersion\":\"02b3c655e1302209ef046da6ba3ef6749dd0b62a\",\"modules\":[],\"allocator\":\"system\",\"environment\":{\"distarch\":\"aarch64\",\"target_arch\":\"aarch64\"}}}}\n",
37
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.532+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":51765, \"ctx\":\"initandlisten\",\"msg\":\"Operating System\",\"attr\":{\"os\":{\"name\":\"Mac OS X\",\"version\":\"22.3.0\"}}}\n",
38
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.532+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":21951, \"ctx\":\"initandlisten\",\"msg\":\"Options set by command line\",\"attr\":{\"options\":{\"storage\":{\"dbPath\":\"../data\"}}}}\n",
39
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.534+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":5693100, \"ctx\":\"initandlisten\",\"msg\":\"Asio socket.set_option failed with std::system_error\",\"attr\":{\"note\":\"acceptor TCP fast open\",\"option\":{\"level\":6,\"name\":261,\"data\":\"00 04 00 00\"},\"error\":{\"what\":\"set_option: Invalid argument\",\"message\":\"Invalid argument\",\"category\":\"asio.system\",\"value\":22}}}\n",
40
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.535+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22270, \"ctx\":\"initandlisten\",\"msg\":\"Storage engine to use detected by data files\",\"attr\":{\"dbpath\":\"../data\",\"storageEngine\":\"wiredTiger\"}}\n",
41
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:45.536+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22315, \"ctx\":\"initandlisten\",\"msg\":\"Opening WiredTiger\",\"attr\":{\"config\":\"create,cache_size=3584M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,remove=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=10,close_handle_minimum=2000),statistics_log=(wait=0),json_output=(error,message),verbose=[recovery_progress:1,checkpoint_progress:1,compact_progress:1,backup:0,checkpoint:0,compact:0,evict:0,history_store:0,recovery:0,rts:0,salvage:0,tiered:0,timestamp:0,transaction:0,verify:0,log:0],\"}}\n",
42
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.331+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":4795906, \"ctx\":\"initandlisten\",\"msg\":\"WiredTiger opened\",\"attr\":{\"durationMillis\":795}}\n",
43
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.331+08:00\"},\"s\":\"I\", \"c\":\"RECOVERY\", \"id\":23987, \"ctx\":\"initandlisten\",\"msg\":\"WiredTiger recoveryTimestamp\",\"attr\":{\"recoveryTimestamp\":{\"$timestamp\":{\"t\":0,\"i\":0}}}}\n",
44
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.342+08:00\"},\"s\":\"W\", \"c\":\"CONTROL\", \"id\":22120, \"ctx\":\"initandlisten\",\"msg\":\"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted\",\"tags\":[\"startupWarnings\"]}\n",
45
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.342+08:00\"},\"s\":\"W\", \"c\":\"CONTROL\", \"id\":22140, \"ctx\":\"initandlisten\",\"msg\":\"This server is bound to localhost. Remote systems will be unable to connect to this server. Start the server with --bind_ip <address> to specify which IP addresses it should serve responses from, or with --bind_ip_all to bind to all interfaces. If this behavior is desired, start the server with --bind_ip 127.0.0.1 to disable this warning\",\"tags\":[\"startupWarnings\"]}\n",
46
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.342+08:00\"},\"s\":\"W\", \"c\":\"CONTROL\", \"id\":22184, \"ctx\":\"initandlisten\",\"msg\":\"Soft rlimits for open file descriptors too low\",\"attr\":{\"currentValue\":4096,\"recommendedMinimum\":64000},\"tags\":[\"startupWarnings\"]}\n",
47
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.348+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":4915702, \"ctx\":\"initandlisten\",\"msg\":\"Updated wire specification\",\"attr\":{\"oldSpec\":{\"incomingExternalClient\":{\"minWireVersion\":0,\"maxWireVersion\":21},\"incomingInternalClient\":{\"minWireVersion\":0,\"maxWireVersion\":21},\"outgoing\":{\"minWireVersion\":6,\"maxWireVersion\":21},\"isInternalClient\":true},\"newSpec\":{\"incomingExternalClient\":{\"minWireVersion\":0,\"maxWireVersion\":21},\"incomingInternalClient\":{\"minWireVersion\":21,\"maxWireVersion\":21},\"outgoing\":{\"minWireVersion\":21,\"maxWireVersion\":21},\"isInternalClient\":true}}}\n",
48
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.348+08:00\"},\"s\":\"I\", \"c\":\"REPL\", \"id\":5853300, \"ctx\":\"initandlisten\",\"msg\":\"current featureCompatibilityVersion value\",\"attr\":{\"featureCompatibilityVersion\":\"7.0\",\"context\":\"startup\"}}\n",
49
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.348+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":5071100, \"ctx\":\"initandlisten\",\"msg\":\"Clearing temp directory\"}\n",
50
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.351+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":6608200, \"ctx\":\"initandlisten\",\"msg\":\"Initializing cluster server parameters from disk\"}\n",
51
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.351+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":20536, \"ctx\":\"initandlisten\",\"msg\":\"Flow Control is enabled on this deployment\"}\n",
52
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.351+08:00\"},\"s\":\"I\", \"c\":\"FTDC\", \"id\":20625, \"ctx\":\"initandlisten\",\"msg\":\"Initializing full-time diagnostic data capture\",\"attr\":{\"dataDirectory\":\"../data/diagnostic.data\"}}\n",
53
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.359+08:00\"},\"s\":\"I\", \"c\":\"REPL\", \"id\":6015317, \"ctx\":\"initandlisten\",\"msg\":\"Setting new configuration state\",\"attr\":{\"newState\":\"ConfigReplicationDisabled\",\"oldState\":\"ConfigPreStart\"}}\n",
54
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.359+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22262, \"ctx\":\"initandlisten\",\"msg\":\"Timestamp monitor starting\"}\n",
55
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.359+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":23015, \"ctx\":\"listener\",\"msg\":\"Listening on\",\"attr\":{\"address\":\"/tmp/mongodb-27017.sock\"}}\n",
56
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.359+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":23015, \"ctx\":\"listener\",\"msg\":\"Listening on\",\"attr\":{\"address\":\"127.0.0.1\"}}\n",
57
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:46.359+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":23016, \"ctx\":\"listener\",\"msg\":\"Waiting for connections\",\"attr\":{\"port\":27017,\"ssl\":\"off\"}}\n",
58
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:50.874+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":22943, \"ctx\":\"listener\",\"msg\":\"Connection accepted\",\"attr\":{\"remote\":\"127.0.0.1:51779\",\"uuid\":{\"uuid\":{\"$uuid\":\"90ca63a5-45ef-48d2-8faa-32df69a5a179\"}},\"connectionId\":1,\"connectionCount\":1}}\n",
59
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:50.875+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":51800, \"ctx\":\"conn1\",\"msg\":\"client metadata\",\"attr\":{\"remote\":\"127.0.0.1:51779\",\"client\":\"conn1\",\"doc\":{\"application\":{\"name\":\"MongoDB Compass\"},\"driver\":{\"name\":\"nodejs\",\"version\":\"6.0.0\"},\"platform\":\"Node.js v18.15.0, LE\",\"os\":{\"name\":\"darwin\",\"architecture\":\"arm64\",\"version\":\"22.3.0\",\"type\":\"Darwin\"}}}}\n"
60
+ ]
61
+ },
62
+ {
63
+ "name": "stdout",
64
+ "output_type": "stream",
65
+ "text": [
66
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:50.952+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":22943, \"ctx\":\"listener\",\"msg\":\"Connection accepted\",\"attr\":{\"remote\":\"127.0.0.1:51781\",\"uuid\":{\"uuid\":{\"$uuid\":\"78f4d7e7-854e-4764-9684-88007ae4260d\"}},\"connectionId\":2,\"connectionCount\":2}}\n",
67
+ "{\"t\":{\"$date\":\"2023-10-31T10:27:50.962+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":51800, \"ctx\":\"conn2\",\"msg\":\"client metadata\",\"attr\":{\"remote\":\"127.0.0.1:51781\",\"client\":\"conn2\",\"doc\":{\"application\":{\"name\":\"MongoDB Compass\"},\"driver\":{\"name\":\"nodejs\",\"version\":\"6.1.0\"},\"platform\":\"Node.js v18.15.0, LE\",\"os\":{\"name\":\"darwin\",\"architecture\":\"arm64\",\"version\":\"22.3.0\",\"type\":\"Darwin\"}}}}\n",
68
+ "^C\n",
69
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.218+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":23377, \"ctx\":\"SignalHandler\",\"msg\":\"Received signal\",\"attr\":{\"signal\":2,\"error\":\"Interrupt: 2\"}}\n",
70
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.218+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":23381, \"ctx\":\"SignalHandler\",\"msg\":\"will terminate after current cmd ends\"}\n",
71
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.218+08:00\"},\"s\":\"I\", \"c\":\"REPL\", \"id\":4784900, \"ctx\":\"SignalHandler\",\"msg\":\"Stepping down the ReplicationCoordinator for shutdown\",\"attr\":{\"waitTimeMillis\":15000}}\n",
72
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.220+08:00\"},\"s\":\"I\", \"c\":\"REPL\", \"id\":4794602, \"ctx\":\"SignalHandler\",\"msg\":\"Attempting to enter quiesce mode\"}\n",
73
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.220+08:00\"},\"s\":\"I\", \"c\":\"-\", \"id\":6371601, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the FLE Crud thread pool\"}\n",
74
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.220+08:00\"},\"s\":\"I\", \"c\":\"COMMAND\", \"id\":4784901, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the MirrorMaestro\"}\n",
75
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.221+08:00\"},\"s\":\"I\", \"c\":\"SHARDING\", \"id\":4784902, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the WaitForMajorityService\"}\n",
76
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.221+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":4784903, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the LogicalSessionCache\"}\n",
77
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.221+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":20562, \"ctx\":\"SignalHandler\",\"msg\":\"Shutdown: going to close listening sockets\"}\n",
78
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.221+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":23017, \"ctx\":\"listener\",\"msg\":\"removing socket file\",\"attr\":{\"path\":\"/tmp/mongodb-27017.sock\"}}\n",
79
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.221+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":4784905, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the global connection pool\"}\n",
80
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.221+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":4784906, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the FlowControlTicketholder\"}\n",
81
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.221+08:00\"},\"s\":\"I\", \"c\":\"-\", \"id\":20520, \"ctx\":\"SignalHandler\",\"msg\":\"Stopping further Flow Control ticket acquisitions.\"}\n",
82
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.221+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":4784908, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the PeriodicThreadToAbortExpiredTransactions\"}\n",
83
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.222+08:00\"},\"s\":\"I\", \"c\":\"REPL\", \"id\":4784909, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the ReplicationCoordinator\"}\n",
84
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.222+08:00\"},\"s\":\"I\", \"c\":\"SHARDING\", \"id\":4784910, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the ShardingInitializationMongoD\"}\n",
85
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.222+08:00\"},\"s\":\"I\", \"c\":\"REPL\", \"id\":4784911, \"ctx\":\"SignalHandler\",\"msg\":\"Enqueuing the ReplicationStateTransitionLock for shutdown\"}\n",
86
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.222+08:00\"},\"s\":\"I\", \"c\":\"-\", \"id\":4784912, \"ctx\":\"SignalHandler\",\"msg\":\"Killing all operations for shutdown\"}\n",
87
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.222+08:00\"},\"s\":\"I\", \"c\":\"-\", \"id\":4695300, \"ctx\":\"SignalHandler\",\"msg\":\"Interrupted all currently running operations\",\"attr\":{\"opsKilled\":5}}\n",
88
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.222+08:00\"},\"s\":\"I\", \"c\":\"TENANT_M\", \"id\":5093807, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down all TenantMigrationAccessBlockers on global shutdown\"}\n",
89
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.222+08:00\"},\"s\":\"I\", \"c\":\"ASIO\", \"id\":22582, \"ctx\":\"TenantMigrationBlockerNet\",\"msg\":\"Killing all outstanding egress activity.\"}\n",
90
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.223+08:00\"},\"s\":\"I\", \"c\":\"ASIO\", \"id\":6529201, \"ctx\":\"SignalHandler\",\"msg\":\"Network interface redundant shutdown\",\"attr\":{\"state\":\"Stopped\"}}\n",
91
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.223+08:00\"},\"s\":\"I\", \"c\":\"ASIO\", \"id\":22582, \"ctx\":\"SignalHandler\",\"msg\":\"Killing all outstanding egress activity.\"}\n",
92
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.223+08:00\"},\"s\":\"I\", \"c\":\"COMMAND\", \"id\":4784913, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down all open transactions\"}\n",
93
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.223+08:00\"},\"s\":\"I\", \"c\":\"REPL\", \"id\":4784914, \"ctx\":\"SignalHandler\",\"msg\":\"Acquiring the ReplicationStateTransitionLock for shutdown\"}\n",
94
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.223+08:00\"},\"s\":\"I\", \"c\":\"INDEX\", \"id\":4784915, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the IndexBuildsCoordinator\"}\n",
95
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.223+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":4784918, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the ReplicaSetMonitor\"}\n",
96
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.223+08:00\"},\"s\":\"I\", \"c\":\"SHARDING\", \"id\":4784921, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the MigrationUtilExecutor\"}\n",
97
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"ASIO\", \"id\":22582, \"ctx\":\"MigrationUtil-TaskExecutor\",\"msg\":\"Killing all outstanding egress activity.\"}\n",
98
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"COMMAND\", \"id\":4784923, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the ServiceEntryPoint\"}\n",
99
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":4784927, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the HealthLog\"}\n",
100
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":4784928, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the TTL monitor\"}\n",
101
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"INDEX\", \"id\":3684100, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down TTL collection monitor thread\"}\n",
102
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"INDEX\", \"id\":3684101, \"ctx\":\"SignalHandler\",\"msg\":\"Finished shutting down TTL collection monitor thread\"}\n",
103
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":6278511, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the Change Stream Expired Pre-images Remover\"}\n",
104
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":4784929, \"ctx\":\"SignalHandler\",\"msg\":\"Acquiring the global lock for shutdown\"}\n",
105
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":4784930, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down the storage engine\"}\n",
106
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22320, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down journal flusher thread\"}\n",
107
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22321, \"ctx\":\"SignalHandler\",\"msg\":\"Finished shutting down journal flusher thread\"}\n",
108
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22322, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down checkpoint thread\"}\n",
109
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22323, \"ctx\":\"SignalHandler\",\"msg\":\"Finished shutting down checkpoint thread\"}\n",
110
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22261, \"ctx\":\"SignalHandler\",\"msg\":\"Timestamp monitor shutting down\"}\n",
111
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":20282, \"ctx\":\"SignalHandler\",\"msg\":\"Deregistering all the collections\"}\n",
112
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22317, \"ctx\":\"SignalHandler\",\"msg\":\"WiredTigerKVEngine shutting down\"}\n",
113
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22318, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down session sweeper thread\"}\n",
114
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22319, \"ctx\":\"SignalHandler\",\"msg\":\"Finished shutting down session sweeper thread\"}\n",
115
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.224+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":4795902, \"ctx\":\"SignalHandler\",\"msg\":\"Closing WiredTiger\",\"attr\":{\"closeConfig\":\"leak_memory=true,use_timestamp=false,\"}}\n",
116
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.226+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":22944, \"ctx\":\"conn1\",\"msg\":\"Connection ended\",\"attr\":{\"remote\":\"127.0.0.1:51779\",\"uuid\":{\"uuid\":{\"$uuid\":\"90ca63a5-45ef-48d2-8faa-32df69a5a179\"}},\"connectionId\":1,\"connectionCount\":1}}\n",
117
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.227+08:00\"},\"s\":\"I\", \"c\":\"NETWORK\", \"id\":22944, \"ctx\":\"conn2\",\"msg\":\"Connection ended\",\"attr\":{\"remote\":\"127.0.0.1:51781\",\"uuid\":{\"uuid\":{\"$uuid\":\"78f4d7e7-854e-4764-9684-88007ae4260d\"}},\"connectionId\":2,\"connectionCount\":0}}\n",
118
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.267+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":4795901, \"ctx\":\"SignalHandler\",\"msg\":\"WiredTiger closed\",\"attr\":{\"durationMillis\":43}}\n",
119
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.267+08:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":22279, \"ctx\":\"SignalHandler\",\"msg\":\"shutdown: removing fs lock...\"}\n",
120
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.267+08:00\"},\"s\":\"I\", \"c\":\"-\", \"id\":4784931, \"ctx\":\"SignalHandler\",\"msg\":\"Dropping the scope cache for shutdown\"}\n",
121
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.267+08:00\"},\"s\":\"I\", \"c\":\"FTDC\", \"id\":20626, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down full-time diagnostic data capture\"}\n",
122
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.272+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":20565, \"ctx\":\"SignalHandler\",\"msg\":\"Now exiting\"}\n",
123
+ "{\"t\":{\"$date\":\"2023-10-31T10:30:00.272+08:00\"},\"s\":\"I\", \"c\":\"CONTROL\", \"id\":23138, \"ctx\":\"SignalHandler\",\"msg\":\"Shutting down\",\"attr\":{\"exitCode\":0}}\n"
124
+ ]
125
+ }
126
+ ],
127
+ "source": [
128
+ "%cd /Users/macbook/opt/mongodb/bin\n",
129
+ "!./mongod --dbpath=../data"
130
+ ]
131
+ },
132
+ {
133
+ "cell_type": "markdown",
134
+ "id": "937ab106",
135
+ "metadata": {},
136
+ "source": [
137
+ "## MongoDB的简单使用"
138
+ ]
139
+ },
140
+ {
141
+ "cell_type": "markdown",
142
+ "id": "23b90ad6",
143
+ "metadata": {},
144
+ "source": [
145
+ "- **db:** 当前正在使用的数据库\n",
146
+ "- **show dbs:** 显示所有数据库\n",
147
+ "- **show databases:** 显示所有数据库\n",
148
+ "- **use xxxx:** 调整操作的数据库\n",
149
+ "- **db.dropDatabase():** 删除正在使用的数据库\n",
150
+ "- **show collections:** 显示当前数据库中所有的集合(表)\n",
151
+ "- **db.collection_name.insert({})**\n",
152
+ "- **db.createCollection(name, {options})** 创建集合 capped:是否卷动, size:大小\n",
153
+ "- **db.collection_name.drop()** 删除集合\n",
154
+ "- **db.collection_name.insert()** 向集合中添加数据( 如果该集合不存在, 自动创建)\n",
155
+ "- **Db.collection_name.isCapped()** 判断是否有容量上限(判断该集合是否是固定容量的集合)\n",
156
+ "\n",
157
+ "- **换行**: shift + enter"
158
+ ]
159
+ },
160
+ {
161
+ "cell_type": "markdown",
162
+ "id": "78227d13",
163
+ "metadata": {},
164
+ "source": [
165
+ "## MongoDB 中常见的数据类型:\n",
166
+ "\n",
167
+ "\n",
168
+ "- **Object ID:** 主键ID\n",
169
+ "- **String:** 字符串\n",
170
+ "- **Boolean:** 布尔值\n",
171
+ "- **Integer:** 数字\n",
172
+ "- **Doube:** 小数\n",
173
+ "- **Arrays:** 数组\n",
174
+ "- **Object:** 文档(关联其他对象) {sname: 李嘉诚, sage: 18, class:{cccc}}\n",
175
+ "- **Null:** 空值\n",
176
+ "- **Timestamp:** 时间戳\n",
177
+ "- **Date:** 时间日期\n"
178
+ ]
179
+ },
180
+ {
181
+ "cell_type": "markdown",
182
+ "id": "fe03b19b",
183
+ "metadata": {},
184
+ "source": [
185
+ "## MongoDB的增删改查"
186
+ ]
187
+ },
188
+ {
189
+ "cell_type": "markdown",
190
+ "id": "23a5d42f",
191
+ "metadata": {},
192
+ "source": [
193
+ "### MongoDB 添加数据\n"
194
+ ]
195
+ },
196
+ {
197
+ "cell_type": "markdown",
198
+ "id": "d1fa79e4",
199
+ "metadata": {},
200
+ "source": [
201
+ "```mongo\n",
202
+ "db.collection_name.insertOne({字段:值,字段:值})\n",
203
+ "\n",
204
+ "db.collection_name.insertMany([{字段:值,字段:值},\n",
205
+ " {字段:值,字段:值},\n",
206
+ " {字段:值,字段:值}])\n",
207
+ "```\n",
208
+ "\n",
209
+ "示例:\n",
210
+ "\n",
211
+ "```mongo\n",
212
+ "db.stu.insertOne({name:\"小猪\", age:18, hobby:[\"吃\", \"喝\", \"拉撒睡\"]})\n",
213
+ "\n",
214
+ "db.stu.insertMany([{name:\"小猪\", age:18, hobby:[\"吃\", \"喝\", \"拉撒睡\"]},\n",
215
+ " {name:\"小羊\", age:18, hobby:[\"吃\", \"喝\", \"拉撒睡\"]},\n",
216
+ " {name:\"小红\", age:18, hobby:[\"吃\", \"喝\", \"拉撒睡\"]}])\n",
217
+ "```\n",
218
+ "\n",
219
+ "注意, 如果集合不存在,则会自动创建集合"
220
+ ]
221
+ },
222
+ {
223
+ "cell_type": "markdown",
224
+ "id": "69e64bd6",
225
+ "metadata": {},
226
+ "source": [
227
+ "### mongodb修改数据\n",
228
+ "\n",
229
+ "**update更新:**\n",
230
+ "\n",
231
+ "```mongo\n",
232
+ "db.collection_name.update({查询条件}, {待修改内容}, {multi: 是否多条数据修改, upsert:true})\n",
233
+ "```\n",
234
+ "\n",
235
+ "示例:\n",
236
+ "\n",
237
+ "```mongo\n",
238
+ "db.stu.update({name:\"小猪\"}, {$set:{title:\"alex\", hobby:[\"抽烟\", \"喝酒\", \"烫头\"]}}, {multi:true})\n",
239
+ "```"
240
+ ]
241
+ },
242
+ {
243
+ "cell_type": "markdown",
244
+ "id": "86754ecd",
245
+ "metadata": {},
246
+ "source": [
247
+ "### MongoDB删除数据\n",
248
+ "\n",
249
+ "**remove()**\n",
250
+ "\n",
251
+ "```\n",
252
+ "db.collection_name.remove({条件}, {justOne:true|false})\n",
253
+ "```\n",
254
+ "\n",
255
+ "示例:\n",
256
+ "\n",
257
+ "```\n",
258
+ "db.stu.remove({name:\"小羊\"}, {justOne:true})\n",
259
+ "```\n",
260
+ "\n",
261
+ "**deleteOne()**\n",
262
+ "\n",
263
+ "```\n",
264
+ "db.collection_name.deleteOne({条件})\n",
265
+ "```\n",
266
+ "\n",
267
+ "示例:\n",
268
+ "\n",
269
+ "```\n",
270
+ "db.stu.deleteOne({name:\"小猪\"})\n",
271
+ "```\n",
272
+ "\n",
273
+ "**deleteMandy()**\n",
274
+ "\n",
275
+ "```\n",
276
+ "db.collection_name.deleteMany({条件})\n",
277
+ "```\n",
278
+ "\n",
279
+ "示例:\n",
280
+ "\n",
281
+ "```\n",
282
+ "db.stu.deleteMany({name:\"小猪\"})\n",
283
+ "```"
284
+ ]
285
+ },
286
+ {
287
+ "cell_type": "markdown",
288
+ "id": "9af7350c",
289
+ "metadata": {},
290
+ "source": [
291
+ "### MongoDB 查询数据\n",
292
+ "\n",
293
+ "#### 准备数据\n",
294
+ "\n",
295
+ "```\n",
296
+ "db.stu.insert([\n",
297
+ " {name: \"朱元璋\", age:800, address:'安徽省凤阳', score: 160},\n",
298
+ " {name: \"朱棣\", age:750, address:'江苏省南京市', score: 120},\n",
299
+ " {name: \"朱高炽\", age:700, address:'北京紫禁城', score: 90},\n",
300
+ " {name: \"李嘉诚\", age:38, address:'香港xxx街道', score: 70},\n",
301
+ " {name: \"麻花藤\", age:28, address:'广东省xxx市', score: 80},\n",
302
+ " {name: \"大老王\", age:33, address:'火星第一卫星', score: -60},\n",
303
+ " {name: \"咩咩\", age:33, address:'开普勒225旁边的黑洞', score: -160}\n",
304
+ "])\n",
305
+ "```\n",
306
+ "\n",
307
+ "#### 普通查询\n",
308
+ "\n",
309
+ "```\n",
310
+ "db.stu.find({条件}) 查询所有\n",
311
+ "db.stu.findOne({}) 查询一个\n",
312
+ "db.stu.find().pretty() 将查询出来的结果进行格式化(好看一些)\n",
313
+ "```"
314
+ ]
315
+ },
316
+ {
317
+ "cell_type": "markdown",
318
+ "id": "854be2ad",
319
+ "metadata": {},
320
+ "source": [
321
+ "#### 比较运算\n",
322
+ "\n",
323
+ "```\n",
324
+ "等于: $eq,默认是等于判断\n",
325
+ "小于: $lt (less than)\n",
326
+ "小于等于: $lte (less than equal)\n",
327
+ "大于: $gt (greater than)\n",
328
+ "大于等于: $gte\n",
329
+ "不等于: $ne\n",
330
+ "```\n",
331
+ "\n",
332
+ "```\n",
333
+ "db.stu.find({age:28}) 查询年龄是28岁的学生信息\n",
334
+ "db.stu.find({age: {$eq: 28}}) 查询年龄是28岁的学生信息\n",
335
+ "db.stu.find({age: {$gt: 30}}) 查询年龄大于30岁的学生\n",
336
+ "db.stu.find({age: {$lt: 30}}) 查询年龄小于30岁的学生\n",
337
+ "db.stu.find({age: {$gte: 38}}) 查询年龄大于等于30岁的学生\n",
338
+ "db.stu.find({age: {$lte: 38}}) 查询年龄小于等于30岁的学生\n",
339
+ "db.stu.find({age: {$ne: 38}}) 查询年龄不等于38的学生\n",
340
+ "```"
341
+ ]
342
+ },
343
+ {
344
+ "cell_type": "markdown",
345
+ "id": "c7e8c1dd",
346
+ "metadata": {},
347
+ "source": [
348
+ "#### 逻辑运算符\n",
349
+ "\n",
350
+ "**1. and**\n",
351
+ "\n",
352
+ "$and: [条件1, 条件2, 条件3....]\n",
353
+ "\n",
354
+ "\n",
355
+ "```\n",
356
+ "db.stu.find({$and:[{age: {$eq:33}}, {name:'大老王'}]}) 查询年龄等于33, 并且, 名字是\"大老王\" 的学生信息\n",
357
+ "```\n",
358
+ "\n",
359
+ "**2. or**\n",
360
+ "\n",
361
+ "$or: [条件1, 条件2, 条件3....]\n",
362
+ "\n",
363
+ "```\n",
364
+ "db.stu.find({$or:[{name: '李嘉诚'}, {age: {$gt: 100}}]}) 查询名字叫\"李嘉诚\"的, 或者, 年龄超过100岁的人\n",
365
+ "```\n",
366
+ "\n",
367
+ "**3. nor**\n",
368
+ " \n",
369
+ "$nor: [条件1, 条件2, 条件3...]\n",
370
+ " \n",
371
+ "\n",
372
+ "```\n",
373
+ "db.stu.find({$nor:[{age: {$lt: 38}}, {name: \"朱元璋\"}]}) 查询年龄不小于38岁的人, 名字还不能是朱元璋. \n",
374
+ "```\n"
375
+ ]
376
+ },
377
+ {
378
+ "cell_type": "markdown",
379
+ "id": "32693e53",
380
+ "metadata": {},
381
+ "source": [
382
+ "#### 范围运算符\n",
383
+ "\n",
384
+ "使用 \\\\$in, \\\\$nin 判断数据 是否在某个数组内\n",
385
+ "\n",
386
+ "```\n",
387
+ "db.stu.find({age: {$in:[28, 38]}}) 年龄是 28 或者 38 的人\n",
388
+ "```"
389
+ ]
390
+ },
391
+ {
392
+ "cell_type": "markdown",
393
+ "id": "18cb5ea2",
394
+ "metadata": {},
395
+ "source": [
396
+ "#### 正则表达式\n",
397
+ "\n",
398
+ "使用 $regex 进行正则表达式匹配\n",
399
+ "\n",
400
+ "```\n",
401
+ "db.stu.find({address: {$regex:'^北京'}}) 查询地址是北京的人的信息\n",
402
+ "db.stu.find({address: /^北京/}) 效果一样\n",
403
+ "```\n",
404
+ "\n",
405
+ "#### 自定义查询(了解)\n",
406
+ "\n",
407
+ "mongo shell 是一个js的执行环境\n",
408
+ "使用 $where 写一个函数, 返回满足���件的数据\n",
409
+ "\n",
410
+ "```\n",
411
+ "db.stu.find({$where:function(){return this.age > 38;}})\n",
412
+ "```"
413
+ ]
414
+ },
415
+ {
416
+ "cell_type": "markdown",
417
+ "id": "52256a43",
418
+ "metadata": {},
419
+ "source": [
420
+ "\n",
421
+ "#### skip 和 limit\n",
422
+ "\n",
423
+ "```\n",
424
+ "db.stu.find().skip(3).limit(3) \n",
425
+ "```\n",
426
+ "\n",
427
+ "跳过3个,提取3个,类似limit 3, 3 可以用来做分页\n",
428
+ "\n",
429
+ "#### 投影\n",
430
+ "\n",
431
+ "投影可以控制最终查询的结果(字段筛选)\n",
432
+ "\n",
433
+ "```\n",
434
+ "db.stu.find({}, {字段:1, 字段:1})\n",
435
+ "```\n",
436
+ "\n",
437
+ "需要看的字段给1就可以了.\n",
438
+ "\n",
439
+ "注意, 除了\\_id外, 0, 1不能共存\n",
440
+ "```\n",
441
+ "db.stu.find({}, {\"name\":1, \"age\":1})\n",
442
+ "```\n"
443
+ ]
444
+ },
445
+ {
446
+ "cell_type": "markdown",
447
+ "id": "2db48e97",
448
+ "metadata": {},
449
+ "source": [
450
+ "#### 排序\n",
451
+ "\n",
452
+ "sort({字段:1, 字段:-1})\n",
453
+ "\n",
454
+ "1表示升序,-1表示降序\n",
455
+ "\n",
456
+ "```\n",
457
+ "db.stu.find().sort({age:1, score: -1}) 对查询结果排序, 先按照 age升序 排列, 相同项再按照 score降序 排列\n",
458
+ "```\n",
459
+ "\n",
460
+ "#### 统计数量\n",
461
+ "\n",
462
+ "count(条件) 查询数量\n",
463
+ "\n",
464
+ "```\n",
465
+ "db.stu.countDocuments({age:33})\n",
466
+ "```"
467
+ ]
468
+ },
469
+ {
470
+ "cell_type": "markdown",
471
+ "id": "f3d3bda8",
472
+ "metadata": {},
473
+ "source": [
474
+ "## MongoDB的管道\n",
475
+ "\n",
476
+ "MongoDB管道 可以将多个操作依次执行, 并将上一次执行的结果传递给下一个管道表达式.\n",
477
+ "\n",
478
+ "**语法:**\n",
479
+ "\n",
480
+ "```\n",
481
+ "db.collection_name.aggregate({管道:{表达式}}, {管道:{表达式}}, {管道:{表达式}}....)\n",
482
+ "```\n",
483
+ "\n",
484
+ "**管道:** \n",
485
+ "\n",
486
+ "- \\$group , 对数据进行分组\n",
487
+ "- \\$match, 对数据进行匹配\n",
488
+ "- \\$project, 对数据进行修改结构, 重命名等\n",
489
+ "- \\$sort, 将数据记性排序\n",
490
+ "- \\$limit, 提取固定数量的数据\n",
491
+ "- \\$skip, 跳过指定数量的数据\n",
492
+ "\n",
493
+ "**表达式:**\n",
494
+ "- \\$sum, 求和\n",
495
+ "- \\$avg, 计算平均值\n",
496
+ "- \\$min, 最小值\n",
497
+ "- \\$max, 最大值\n",
498
+ "- \\$push, 在结果中插⼊值到⼀个数组中\n",
499
+ "\n",
500
+ "**案例:**\n",
501
+ "\n",
502
+ "```\n",
503
+ "# 根据性别进行分组\n",
504
+ "db.stu.aggregate({$group: {_id:'$gender'}})\n",
505
+ "\n",
506
+ "# 统计男生和女声的数量\n",
507
+ "db.stu.aggregate({$group: {_id:'$gender', cou:{$sum: 1}}}) \n",
508
+ "\n",
509
+ "# 统计男生女生数量, 平均成绩以及最高分\n",
510
+ "db.stu.aggregate({$group: {_id:'$gender', cou:{$sum:1}, \n",
511
+ " avg_score: {$avg:'$score'}, \n",
512
+ " max_score: {$max: '$score'}}})\n",
513
+ "```\n"
514
+ ]
515
+ },
516
+ {
517
+ "cell_type": "markdown",
518
+ "id": "e8ca7d74",
519
+ "metadata": {},
520
+ "source": [
521
+ "**\\$push的使用:**\n",
522
+ "\n",
523
+ "想拿到分组后的人员名单, 此时就可以用\\$push将名称字段整理到一个列表中\n",
524
+ "\n",
525
+ "```\n",
526
+ "db.stu.aggregate({$group: {_id:'$gender', cou:{$sum:1}, \n",
527
+ " avg_score: {$avg:'$score'}, \n",
528
+ " max_score: {$max: '$score'}, \n",
529
+ " name_list: {$push: '$name'}}})\n",
530
+ "```\n",
531
+ "\n",
532
+ "效果:\n",
533
+ "```\n",
534
+ "{\n",
535
+ " \"_id\" : false, \n",
536
+ " \"cou\" : 3, \n",
537
+ " \"avg_score\" : 123.33333333333333, \n",
538
+ " \"max_score\" : 160, \n",
539
+ " \"name_list\" : [ \"朱元璋\", \"朱棣\", \"朱高炽\" ] \n",
540
+ "}\n",
541
+ "\n",
542
+ "{ \n",
543
+ " \"_id\" : true, \n",
544
+ " \"cou\" : 4, \n",
545
+ " \"avg_score\" : -17.5, \n",
546
+ " \"max_score\" : 80, \n",
547
+ " \"name_list\" : [ \"李嘉诚\", \"麻花藤\", \"大老王\", \"咩咩\" ] \n",
548
+ "}\n",
549
+ "```\n",
550
+ "\n"
551
+ ]
552
+ },
553
+ {
554
+ "cell_type": "markdown",
555
+ "id": "64023610",
556
+ "metadata": {},
557
+ "source": [
558
+ "**\\$match的使用:**\n",
559
+ "\n",
560
+ "可以对数据进行检索, 然后可以进入其它管道\n",
561
+ "\n",
562
+ "```\n",
563
+ "db.stu.aggregate({$match:{age:{$gt:33}}}, {$group:{_id:\"$gender\", name_list:{$push:\"$name\"}}})\n",
564
+ "```\n",
565
+ "\n"
566
+ ]
567
+ },
568
+ {
569
+ "cell_type": "markdown",
570
+ "id": "4f9f5fc3",
571
+ "metadata": {},
572
+ "source": [
573
+ "**\\$project的使用:**\n",
574
+ "\n",
575
+ "可以对管道中的数据进行投影\n",
576
+ "\n",
577
+ "```\n",
578
+ "db.stu.aggregate({$match:{age:{$gt:33}}}, \n",
579
+ " {$group:{_id:\"$gender\", count:{$sum:1}, name_list:{$push:\"$name\"}}}, \n",
580
+ " {$project:{_id:0, name_list:1}})\n",
581
+ "```\n",
582
+ "\n",
583
+ "**\\$sort的使用:**\n",
584
+ "\n",
585
+ "可以对管道中的数据进行排序\n",
586
+ "\n",
587
+ "```\n",
588
+ "db.stu.aggregate({$match:{age:{$gt:33}}}, \n",
589
+ " {$group:{_id:\"$gender\", count:{$sum:1}, name_list:{$push:\"$name\"}}}, \n",
590
+ " {$sort:{count: 1}})\n",
591
+ "```\n",
592
+ "\n",
593
+ "**\\\\$limit 和 \\\\$skip 的使用:**\n",
594
+ "\n",
595
+ "可以对管道中的数据进行分页查询\n",
596
+ "\n",
597
+ "```\n",
598
+ "db.stu.aggregate({$match:{age:{$gt:33}}}, \n",
599
+ " {$group:{_id:\"$gender\", count:{$sum:1}, name_list:{$push:\"$name\"}}}, \n",
600
+ " {$sort:{count: 1}},\n",
601
+ " {$skip:1}, \n",
602
+ " {$limit:1})\n",
603
+ "```\n"
604
+ ]
605
+ },
606
+ {
607
+ "cell_type": "markdown",
608
+ "id": "30155210",
609
+ "metadata": {},
610
+ "source": [
611
+ "## MongoDB的索引操作\n",
612
+ "\n",
613
+ "索引可以非常明显的提高我们查询的效率. 但是要注意, 创建索引后, 对查询效率是有显著提高的. 但是对增加数据而言效率是会变低的.\n",
614
+ "\n",
615
+ "**添加索引:**\n",
616
+ "\n",
617
+ "```mongo\n",
618
+ "db.collection_name.ensureIndex({属性:1}) # 1 正序, -1 倒叙\n",
619
+ "```\n",
620
+ "\n",
621
+ "我们多加一些数据到mongodb. 分别看看加索引和不加索引的执行效率.\n",
622
+ "\n",
623
+ "```mongo\n",
624
+ "for(i = 1; i < 100000; i++) db.tt.insert({\"test\": 'god'+i})\n",
625
+ "```\n",
626
+ "\n",
627
+ "**查询:**\n",
628
+ "\n",
629
+ "```mongo\n",
630
+ "db.tt.find({test:'god99999'}).explain(\"executionStats\")\n",
631
+ "```\n",
632
+ "\n",
633
+ "**查询效率:**\n",
634
+ "\n",
635
+ "\"executionTimeMillis\" : 64,\n",
636
+ "\n",
637
+ "**加索引:**\n",
638
+ "\n",
639
+ "```\n",
640
+ "db.tt.ensureIndex({test:1})\n",
641
+ "```\n",
642
+ "\n",
643
+ "**再次查询:**\n",
644
+ "\n",
645
+ "\"executionTimeMillis\" : 0,\n",
646
+ "\n",
647
+ "\n",
648
+ "**查看所有索引:**\n",
649
+ "\n",
650
+ "```\n",
651
+ "db.collection_name.getIndexes()\n",
652
+ "```\n",
653
+ "\n",
654
+ "**删除索引:**\n",
655
+ "\n",
656
+ "```\n",
657
+ "db.collection_name.dropIndex({属性: 1})\n",
658
+ "```"
659
+ ]
660
+ },
661
+ {
662
+ "cell_type": "markdown",
663
+ "id": "6e4966b8",
664
+ "metadata": {},
665
+ "source": [
666
+ "## MongoDB的权限管理\n",
667
+ "\n",
668
+ "mongodb的用户权限是跟着数据库走的,除了超级管理员外,其他管理员只能管理自己的库\n",
669
+ "\n",
670
+ "创建超级管理员\n",
671
+ "\n",
672
+ "首先, 将数据库调整到admin库.\n",
673
+ "\n",
674
+ "```mongo\n",
675
+ "use admin\n",
676
+ "```\n",
677
+ "\n",
678
+ "然后, 创建一个root超级管理员账号\n",
679
+ "\n",
680
+ "```\n",
681
+ "db.createUser({user:\"用户名\", pwd: \"密码\", roles:['root']})\n",
682
+ "db.createUser({user:\"sylar\", pwd: \"123456\", roles:['root']})\n",
683
+ "```\n",
684
+ "\n",
685
+ "创建完成后. 需要退出mongodb. 然后修改配置文件:\n",
686
+ "\n",
687
+ "mac和linux:\n",
688
+ "\n",
689
+ "```config\n",
690
+ "dbpath=/usr/local/mongodb\n",
691
+ "port=27017\n",
692
+ "logpath=/usr/local/var/log/mongodb/mongo.log\n",
693
+ "fork=true\n",
694
+ "logappend=true\n",
695
+ "auth=true # 加上账户认证\n",
696
+ "```\n",
697
+ "\n",
698
+ "windows:\n",
699
+ "\n",
700
+ "```config\n",
701
+ "storage:\n",
702
+ " dbPath: D:\\MongoDB\\Server\\4.4\\data\n",
703
+ " journal:\n",
704
+ " enabled: true\n",
705
+ "\n",
706
+ "systemLog:\n",
707
+ " destination: file\n",
708
+ " logAppend: true\n",
709
+ " path: D:\\MongoDB\\Server\\4.4\\log\\mongod.log\n",
710
+ "\n",
711
+ "net:\n",
712
+ " port: 27017\n",
713
+ " bindIp: 127.0.0.1\n",
714
+ "\n",
715
+ "# 注意: security要顶格, authorization要空两格, enabled前面要有个空格\n",
716
+ "security:\n",
717
+ " authorization: enabled\n",
718
+ "```\n",
719
+ "\n",
720
+ "然后, 需要重新启动mongodb的服务(linux和mac直接杀掉进程, 重新启动即可, windows去系统服务里重启MongoDB的服务).\n",
721
+ "\n",
722
+ "然后重新打开mongo, 先进入admin, 登录超级管理员账号, 进入到你想要单独创建管理员的数据库. 然后创建出该数据库的管理员账号\n",
723
+ "\n",
724
+ "```\n",
725
+ "> use admin\n",
726
+ "switched to db admin\n",
727
+ "> db.auth(\"sylar\",\"123456\")\n",
728
+ "1\n",
729
+ "> use ddd\n",
730
+ "switched to db ddd\n",
731
+ "> db.createUser({user:\"ttt_admin\", pwd:\"123456\", roles:[\"readWrite\"]})\n",
732
+ "```\n",
733
+ "\n",
734
+ "退出管理员账号, 重新登录刚刚创建好的账号\n",
735
+ "\n",
736
+ "```\n",
737
+ "> use ddd\n",
738
+ "switched to db ddd\n",
739
+ "> db.auth(\"ttt_admin\", \"123456\")\n",
740
+ "1\n",
741
+ "> db.stu.insert({name: 123, age:3})\n",
742
+ "WriteResult({ \"nInserted\" : 1 })\n",
743
+ ">\n",
744
+ "```\n",
745
+ "\n",
746
+ "==注意, 每个账号只能管理自己的数据库(可以是多个).=="
747
+ ]
748
+ },
749
+ {
750
+ "cell_type": "markdown",
751
+ "id": "4e36db83",
752
+ "metadata": {},
753
+ "source": [
754
+ "## pymongo的使用"
755
+ ]
756
+ },
757
+ {
758
+ "cell_type": "markdown",
759
+ "id": "4fde2d24",
760
+ "metadata": {},
761
+ "source": [
762
+ "### 建立连接"
763
+ ]
764
+ },
765
+ {
766
+ "cell_type": "code",
767
+ "execution_count": 7,
768
+ "id": "816dd7c3",
769
+ "metadata": {
770
+ "ExecuteTime": {
771
+ "end_time": "2023-10-31T02:30:05.399441Z",
772
+ "start_time": "2023-10-31T02:30:00.436333Z"
773
+ },
774
+ "collapsed": true
775
+ },
776
+ "outputs": [
777
+ {
778
+ "ename": "KeyboardInterrupt",
779
+ "evalue": "",
780
+ "output_type": "error",
781
+ "traceback": [
782
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
783
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
784
+ "Input \u001b[0;32mIn [7]\u001b[0m, in \u001b[0;36m<cell line: 14>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;66;03m# # 登录该数据库\u001b[39;00m\n\u001b[1;32m 10\u001b[0m \u001b[38;5;66;03m# py.authenticate(\"python_admin\", '123456')\u001b[39;00m\n\u001b[1;32m 11\u001b[0m \n\u001b[1;32m 12\u001b[0m \u001b[38;5;66;03m# 简单来个查询\u001b[39;00m\n\u001b[1;32m 13\u001b[0m result \u001b[38;5;241m=\u001b[39m py[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstu\u001b[39m\u001b[38;5;124m\"\u001b[39m]\u001b[38;5;241m.\u001b[39mfind()\n\u001b[0;32m---> 14\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m result:\n\u001b[1;32m 15\u001b[0m \u001b[38;5;28mprint\u001b[39m(r)\n",
785
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/site-packages/pymongo/cursor.py:1280\u001b[0m, in \u001b[0;36mCursor.next\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1278\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__empty:\n\u001b[1;32m 1279\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m\n\u001b[0;32m-> 1280\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__data) \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_refresh\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m:\n\u001b[1;32m 1281\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__manipulate:\n\u001b[1;32m 1282\u001b[0m _db \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__collection\u001b[38;5;241m.\u001b[39mdatabase\n",
786
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/site-packages/pymongo/cursor.py:1165\u001b[0m, in \u001b[0;36mCursor._refresh\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1162\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__data)\n\u001b[1;32m 1164\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__session:\n\u001b[0;32m-> 1165\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__session \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__collection\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdatabase\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mclient\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_ensure_session\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1167\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__id \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m: \u001b[38;5;66;03m# Query\u001b[39;00m\n\u001b[1;32m 1168\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__min \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__max) \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__hint:\n",
787
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/site-packages/pymongo/mongo_client.py:2027\u001b[0m, in \u001b[0;36mMongoClient._ensure_session\u001b[0;34m(self, session)\u001b[0m\n\u001b[1;32m 2022\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m session\n\u001b[1;32m 2024\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 2025\u001b[0m \u001b[38;5;66;03m# Don't make implicit sessions causally consistent. Applications\u001b[39;00m\n\u001b[1;32m 2026\u001b[0m \u001b[38;5;66;03m# should always opt-in.\u001b[39;00m\n\u001b[0;32m-> 2027\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__start_session\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcausal_consistency\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m 2028\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (ConfigurationError, InvalidOperation):\n\u001b[1;32m 2029\u001b[0m \u001b[38;5;66;03m# Sessions not supported, or multiple users authenticated.\u001b[39;00m\n\u001b[1;32m 2030\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n",
788
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/site-packages/pymongo/mongo_client.py:1976\u001b[0m, in \u001b[0;36mMongoClient.__start_session\u001b[0;34m(self, implicit, **kwargs)\u001b[0m\n\u001b[1;32m 1971\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InvalidOperation(\n\u001b[1;32m 1972\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCannot call start_session when\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m multiple users are authenticated\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1973\u001b[0m )\n\u001b[1;32m 1975\u001b[0m \u001b[38;5;66;03m# Raises ConfigurationError if sessions are not supported.\u001b[39;00m\n\u001b[0;32m-> 1976\u001b[0m server_session \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_get_server_session\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1977\u001b[0m opts \u001b[38;5;241m=\u001b[39m client_session\u001b[38;5;241m.\u001b[39mSessionOptions(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 1978\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m client_session\u001b[38;5;241m.\u001b[39mClientSession(\u001b[38;5;28mself\u001b[39m, server_session, opts, authset, implicit)\n",
789
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/site-packages/pymongo/mongo_client.py:2013\u001b[0m, in \u001b[0;36mMongoClient._get_server_session\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 2011\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_get_server_session\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 2012\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Internal: start or resume a _ServerSession.\"\"\"\u001b[39;00m\n\u001b[0;32m-> 2013\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_topology\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_server_session\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
790
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/site-packages/pymongo/topology.py:525\u001b[0m, in \u001b[0;36mTopology.get_server_session\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 522\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lock:\n\u001b[1;32m 523\u001b[0m \u001b[38;5;66;03m# Sessions are always supported in load balanced mode.\u001b[39;00m\n\u001b[1;32m 524\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_settings\u001b[38;5;241m.\u001b[39mload_balanced:\n\u001b[0;32m--> 525\u001b[0m session_timeout \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_check_session_support\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 526\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 527\u001b[0m \u001b[38;5;66;03m# Sessions never time out in load balanced mode.\u001b[39;00m\n\u001b[1;32m 528\u001b[0m session_timeout \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mfloat\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124minf\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
791
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/site-packages/pymongo/topology.py:507\u001b[0m, in \u001b[0;36mTopology._check_session_support\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 505\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_description\u001b[38;5;241m.\u001b[39mtopology_type \u001b[38;5;241m==\u001b[39m TOPOLOGY_TYPE\u001b[38;5;241m.\u001b[39mSingle:\n\u001b[1;32m 506\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_description\u001b[38;5;241m.\u001b[39mhas_known_servers:\n\u001b[0;32m--> 507\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_select_servers_loop\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 508\u001b[0m \u001b[43m \u001b[49m\u001b[43many_server_selector\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_settings\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mserver_selection_timeout\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\n\u001b[1;32m 509\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 510\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_description\u001b[38;5;241m.\u001b[39mreadable_servers:\n\u001b[1;32m 511\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_select_servers_loop(\n\u001b[1;32m 512\u001b[0m readable_server_selector, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_settings\u001b[38;5;241m.\u001b[39mserver_selection_timeout, \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 513\u001b[0m )\n",
792
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/site-packages/pymongo/topology.py:238\u001b[0m, in \u001b[0;36mTopology._select_servers_loop\u001b[0;34m(self, selector, timeout, address)\u001b[0m\n\u001b[1;32m 232\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_request_check_all()\n\u001b[1;32m 234\u001b[0m \u001b[38;5;66;03m# Release the lock and wait for the topology description to\u001b[39;00m\n\u001b[1;32m 235\u001b[0m \u001b[38;5;66;03m# change, or for a timeout. We won't miss any changes that\u001b[39;00m\n\u001b[1;32m 236\u001b[0m \u001b[38;5;66;03m# came after our most recent apply_selector call, since we've\u001b[39;00m\n\u001b[1;32m 237\u001b[0m \u001b[38;5;66;03m# held the lock until now.\u001b[39;00m\n\u001b[0;32m--> 238\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_condition\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mwait\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcommon\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mMIN_HEARTBEAT_INTERVAL\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 239\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_description\u001b[38;5;241m.\u001b[39mcheck_compatible()\n\u001b[1;32m 240\u001b[0m now \u001b[38;5;241m=\u001b[39m _time()\n",
793
+ "File \u001b[0;32m~/opt/anaconda3/lib/python3.9/threading.py:316\u001b[0m, in \u001b[0;36mCondition.wait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 314\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 315\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m timeout \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[0;32m--> 316\u001b[0m gotit \u001b[38;5;241m=\u001b[39m \u001b[43mwaiter\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43macquire\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 317\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 318\u001b[0m gotit \u001b[38;5;241m=\u001b[39m waiter\u001b[38;5;241m.\u001b[39macquire(\u001b[38;5;28;01mFalse\u001b[39;00m)\n",
794
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
795
+ ]
796
+ }
797
+ ],
798
+ "source": [
799
+ "import pymongo\n",
800
+ "\n",
801
+ "# 建立连接\n",
802
+ "conn = pymongo.MongoClient(host='localhost', port=27017)\n",
803
+ "\n",
804
+ "# 切换数据库\n",
805
+ "py = conn['MyMongoDB']\n",
806
+ "\n",
807
+ "# 登录该数据库\n",
808
+ "py.authenticate(\"python_admin\", '123456')\n",
809
+ "\n",
810
+ "# 简单来个查询\n",
811
+ "result = py[\"stu\"].find()\n",
812
+ "for r in result:\n",
813
+ " print(r)"
814
+ ]
815
+ },
816
+ {
817
+ "cell_type": "markdown",
818
+ "id": "6ce60d4f",
819
+ "metadata": {},
820
+ "source": [
821
+ "### 完成增删改查"
822
+ ]
823
+ },
824
+ {
825
+ "cell_type": "code",
826
+ "execution_count": null,
827
+ "id": "ad4d86da",
828
+ "metadata": {},
829
+ "outputs": [],
830
+ "source": [
831
+ "from concurrent.futures import ThreadPoolExecutor\n",
832
+ "import mongodb\n",
833
+ "from lxml import etree\n",
834
+ "import requests\n",
835
+ "import pymongo\n",
836
+ "from pymongo import MongoClient\n",
837
+ "\n",
838
+ "\n",
839
+ "def get_db(database, user, pwd):\n",
840
+ " client = MongoClient(host=\"localhost\", port=27017)\n",
841
+ " db = client[database]\n",
842
+ " # 有账号就加上验证, 没有账号就不用验证\n",
843
+ " db.authenticate(user, pwd)\n",
844
+ " return db\n",
845
+ "\n",
846
+ "\n",
847
+ "# 增删改查\n",
848
+ "# 增加数据\n",
849
+ "def add_one(table, data):\n",
850
+ " db = get_db(\"python\", \"python_admin\", \"123456\")\n",
851
+ " result = db[table].insert_one(data)\n",
852
+ " return result\n",
853
+ "\n",
854
+ "\n",
855
+ "def add_many(table, data_list):\n",
856
+ " db = get_db(\"python\", \"python_admin\", \"123456\")\n",
857
+ " result = db[table].insert_many(data_list)\n",
858
+ " return result.inserted_ids\n",
859
+ "\n",
860
+ "\n",
861
+ "def upd(table, condition, data):\n",
862
+ " db = get_db(\"python\", \"python_admin\", \"123456\")\n",
863
+ " data = {'hehe': 'hehe', 'meme': 'meme'}\n",
864
+ " # result = db[table].update_many(condition, {\"$set\": data})\n",
865
+ " result = db[table].update_many(condition, {'$set': data})\n",
866
+ " return result\n",
867
+ "\n",
868
+ "\n",
869
+ "def delete(table, condition):\n",
870
+ " db = get_db(\"python\", \"python_admin\", \"123456\")\n",
871
+ " result = db[table].remove(condition)\n",
872
+ " return result\n",
873
+ "\n",
874
+ "\n",
875
+ "if __name__ == '__main__':\n",
876
+ " # r = add_one(\"stu\", {\"name\": \"西瓜\", \"age\":18})\n",
877
+ " # print(r.inserted_id)\n",
878
+ " # r = add_many(\"stu\", [{\"name\": \"嘎嘎\"},{\"name\": \"咔咔\"}])\n",
879
+ " # print(r.inserted_ids)\n",
880
+ "\n",
881
+ " # result = upd(\"stu\", {\"name\": 99999}, {\"age\": 100})\n",
882
+ " # print(result)\n",
883
+ "\n",
884
+ " result = delete(\"stu\", {\"name\": \"哈哈\"})\n",
885
+ " print(result)\n",
886
+ "\n",
887
+ "\n",
888
+ "\n",
889
+ "def get_page_source(url):\n",
890
+ " resp = requests.get(url)\n",
891
+ " page_source = resp.text\n",
892
+ " return page_source\n",
893
+ "\n",
894
+ "\n",
895
+ "def parse_html(html):\n",
896
+ " tree = etree.HTML(html)\n",
897
+ " # print(html)\n",
898
+ " li_list = tree.xpath(\"//ul[@class='sellListContent']/li\")\n",
899
+ " print(\"==>\", len(li_list))\n",
900
+ " try:\n",
901
+ " lst = []\n",
902
+ " for li in li_list:\n",
903
+ " title = li.xpath(\"./div[1]/div[1]/a/text()\")[0]\n",
904
+ " position_info = \"-\".join((s.strip()\n",
905
+ " for s in li.xpath(\"./div[1]/div[2]/div/a/text()\")))\n",
906
+ "\n",
907
+ " temp = li.xpath(\"./div[1]/div[3]/div/text()\")[0].split(\" | \")\n",
908
+ " if len(temp) == 6:\n",
909
+ " temp.insert(5, \"\")\n",
910
+ " elif len(temp) == 8:\n",
911
+ " temp.pop()\n",
912
+ " huxing, mianji, chaoxiang, zhangxiu, louceng, nianfen, jiegou = temp\n",
913
+ " guanzhu, fabushijian = li.xpath(\n",
914
+ " \"./div[1]/div[4]/text()\")[0].split(\" / \")\n",
915
+ " tags = li.xpath(\"./div[1]/div[5]/span/text()\")\n",
916
+ "\n",
917
+ " data = {\n",
918
+ " \"title\": title,\n",
919
+ " \"position\": position_info,\n",
920
+ " \"huxing\": huxing,\n",
921
+ " \"mianji\": mianji,\n",
922
+ " \"chaoxiang\": chaoxiang,\n",
923
+ " \"zhangxiu\": zhangxiu,\n",
924
+ " \"louceng\": louceng,\n",
925
+ " \"nianfen\": nianfen,\n",
926
+ " \"jiegou\": jiegou,\n",
927
+ " \"guanzhu\": guanzhu,\n",
928
+ " \"fabushijian\": fabushijian,\n",
929
+ " \"tags\": tags\n",
930
+ " }\n",
931
+ " lst.append(data)\n",
932
+ " # 一起存入mongodb\n",
933
+ " print(f\"数据量\", len(lst))\n",
934
+ " result = mongodb.add_many(\"ershoufang\", lst)\n",
935
+ " print(f\"插入{len(result)}\")\n",
936
+ " except Exception as e:\n",
937
+ " print(e)\n",
938
+ " print(temp)\n",
939
+ "\n",
940
+ "\n",
941
+ "def main(url):\n",
942
+ " page_source = get_page_source(url)\n",
943
+ " parse_html(page_source)\n",
944
+ "\n",
945
+ "\n",
946
+ "if __name__ == '__main__':\n",
947
+ " with ThreadPoolExecutor(10) as t:\n",
948
+ " for i in range(1, 31):\n",
949
+ " url = f\"https://bj.lianjia.com/ershoufang/pg{i}/\"\n",
950
+ " t.submit(main, url)"
951
+ ]
952
+ },
953
+ {
954
+ "cell_type": "code",
955
+ "execution_count": null,
956
+ "id": "d621aa64",
957
+ "metadata": {},
958
+ "outputs": [],
959
+ "source": []
960
+ },
961
+ {
962
+ "cell_type": "code",
963
+ "execution_count": null,
964
+ "id": "19ebd2eb",
965
+ "metadata": {},
966
+ "outputs": [],
967
+ "source": []
968
+ }
969
+ ],
970
+ "metadata": {
971
+ "kernelspec": {
972
+ "display_name": "Python 3 (ipykernel)",
973
+ "language": "python",
974
+ "name": "python3"
975
+ },
976
+ "language_info": {
977
+ "codemirror_mode": {
978
+ "name": "ipython",
979
+ "version": 3
980
+ },
981
+ "file_extension": ".py",
982
+ "mimetype": "text/x-python",
983
+ "name": "python",
984
+ "nbconvert_exporter": "python",
985
+ "pygments_lexer": "ipython3",
986
+ "version": "3.9.12"
987
+ },
988
+ "toc": {
989
+ "base_numbering": 1,
990
+ "nav_menu": {},
991
+ "number_sections": true,
992
+ "sideBar": true,
993
+ "skip_h1_title": false,
994
+ "title_cell": "Table of Contents",
995
+ "title_sidebar": "Contents",
996
+ "toc_cell": false,
997
+ "toc_position": {
998
+ "height": "calc(100% - 180px)",
999
+ "left": "10px",
1000
+ "top": "150px",
1001
+ "width": "278.797px"
1002
+ },
1003
+ "toc_section_display": true,
1004
+ "toc_window_display": true
1005
+ }
1006
+ },
1007
+ "nbformat": 4,
1008
+ "nbformat_minor": 5
1009
+ }
data/.DS_Store ADDED
Binary file (6.15 kB). View file
 
data/chaojiying_Python/__pycache__/chaojiying.cpython-39.pyc ADDED
Binary file (1.93 kB). View file
 
data/chaojiying_Python/a.jpg ADDED
data/chaojiying_Python/chaojiying.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+ # coding:utf-8
3
+ import requests
4
+ from hashlib import md5
5
+
6
+ class Chaojiying_Client(object):
7
+
8
+ def __init__(self, username, password, soft_id):
9
+ self.username = username
10
+ password = password.encode('utf8')
11
+ self.password = md5(password).hexdigest()
12
+ self.soft_id = soft_id
13
+ self.base_params = {
14
+ 'user': self.username,
15
+ 'pass2': self.password,
16
+ 'softid': self.soft_id,
17
+ }
18
+ self.headers = {
19
+ 'Connection': 'Keep-Alive',
20
+ 'User-Agent': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)',
21
+ }
22
+
23
+ def PostPic(self, im, codetype):
24
+ """
25
+ im: 图片字节
26
+ codetype: 题目类型 参考 http://www.chaojiying.com/price.html
27
+ """
28
+ params = {
29
+ 'codetype': codetype,
30
+ }
31
+ params.update(self.base_params)
32
+ files = {'userfile': ('ccc.jpg', im)}
33
+ r = requests.post('http://upload.chaojiying.net/Upload/Processing.php', data=params, files=files, headers=self.headers)
34
+ return r.json()
35
+
36
+ def ReportError(self, im_id):
37
+ """
38
+ im_id:报错题目的图片ID
39
+ """
40
+ params = {
41
+ 'id': im_id,
42
+ }
43
+ params.update(self.base_params)
44
+ r = requests.post('http://upload.chaojiying.net/Upload/ReportError.php', data=params, headers=self.headers)
45
+ return r.json()
46
+
47
+ def get_code(img_src,cpt_type=1004):
48
+ chaojiying = Chaojiying_Client('feelingslw', '123456', '919647') #用户中心>>软件ID 生成一个替换 96001
49
+ im = open(img_src, 'rb').read() #本地图片文件路径 来替换 a.jpg 有时WIN系统须要//
50
+ return chaojiying.PostPic(im,cpt_type).get('pic_str')
51
+
52
+ if __name__ == '__main__':
53
+ print(get_code('chaojiying_Python/untitled.png'))
54
+
data/chaojiying_Python/untitled.png ADDED
data/city.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"state": 1, "message": "success", "content": {"data": {"allCitySearchLabels": {"A": [{"id": 723, "name": "安阳", "parentId": 545, "code": "171500000", "isSelected": false}, {"id": 671, "name": "安庆", "parentId": 541, "code": "131800000", "isSelected": false}, {"id": 862, "name": "安康", "parentId": 556, "code": "270400000", "isSelected": false}, {"id": 825, "name": "安顺", "parentId": 553, "code": "240400000", "isSelected": false}, {"id": 601, "name": "鞍山", "parentId": 535, "code": "081600000", "isSelected": false}, {"id": 105795, "name": "澳门", "parentId": 562, "code": "330100000", "isSelected": false}, {"id": 598, "name": "阿拉善盟", "parentId": 534, "code": "070300000", "isSelected": false}, {"id": 819, "name": "阿坝藏族羌族自治州", "parentId": 552, "code": "230700000", "isSelected": false}, {"id": 108412, "name": "阿拉尔", "parentId": 560, "code": "312600000", "isSelected": false}], "B": [{"id": 5, "name": "北京", "parentId": 1, "code": "010100000", "isSelected": false}, {"id": 570, "name": "保定", "parentId": 532, "code": "051100000", "isSelected": false}, {"id": 588, "name": "包头", "parentId": 534, "code": "071300000", "isSelected": false}, {"id": 717, "name": "滨州", "parentId": 544, "code": "161400000", "isSelected": false}, {"id": 666, "name": "蚌埠", "parentId": 541, "code": "131300000", "isSelected": false}, {"id": 856, "name": "宝鸡", "parentId": 556, "code": "271000000", "isSelected": false}, {"id": 789, "name": "北海", "parentId": 549, "code": "211000000", "isSelected": false}, {"id": 678, "name": "亳州", "parentId": 541, "code": "130500000", "isSelected": false}, {"id": 828, "name": "毕节", "parentId": 553, "code": "240700000", "isSelected": false}, {"id": 794, "name": "百色", "parentId": 549, "code": "210500000", "isSelected": false}, {"id": 834, "name": "保山", "parentId": 554, "code": "251400000", "isSelected": false}, {"id": 603, "name": "本溪", "parentId": 535, "code": "081400000", "isSelected": false}, {"id": 896, "name": "巴音郭楞", "parentId": 560, "code": "311700000", "isSelected": false}, {"id": 817, "name": "巴中", "parentId": 552, "code": "230500000", "isSelected": false}, {"id": 867, "name": "白银", "parentId": 557, "code": "281100000", "isSelected": false}, {"id": 597, "name": "巴彦淖尔", "parentId": 534, "code": "070400000", "isSelected": false}, {"id": 620, "name": "白城", "parentId": 536, "code": "090400000", "isSelected": false}, {"id": 618, "name": "白山", "parentId": 536, "code": "090600000", "isSelected": false}, {"id": 108406, "name": "北屯", "parentId": 560, "code": "312000000", "isSelected": false}], "C": [{"id": 801, "name": "成都", "parentId": 552, "code": "230100000", "isSelected": false}, {"id": 749, "name": "长沙", "parentId": 547, "code": "190100000", "isSelected": false}, {"id": 8, "name": "重庆", "parentId": 4, "code": "040100000", "isSelected": false}, {"id": 613, "name": "长春", "parentId": 536, "code": "090100000", "isSelected": false}, {"id": 638, "name": "常州", "parentId": 539, "code": "112000000", "isSelected": false}, {"id": 573, "name": "沧州", "parentId": 532, "code": "050800000", "isSelected": false}, {"id": 758, "name": "郴州", "parentId": 547, "code": "190500000", "isSelected": false}, {"id": 590, "name": "赤峰", "parentId": 534, "code": "071100000", "isSelected": false}, {"id": 572, "name": "承德", "parentId": 532, "code": "050900000", "isSelected": false}, {"id": 755, "name": "常德", "parentId": 547, "code": "190800000", "isSelected": false}, {"id": 673, "name": "滁州", "parentId": 541, "code": "131100000", "isSelected": false}, {"id": 781, "name": "潮州", "parentId": 548, "code": "200500000", "isSelected": false}, {"id": 611, "name": "朝阳", "parentId": 535, "code": "080600000", "isSelected": false}, {"id": 836, "name": "楚雄", "parentId": 554, "code": "251200000", "isSelected": false}, {"id": 108405, "name": "澄迈", "parentId": 550, "code": "223400000", "isSelected": false}, {"id": 679, "name": "池州", "parentId": 541, "code": "130600000", "isSelected": false}, {"id": 894, "name": "昌吉", "parentId": 560, "code": "311500000", "isSelected": false}, {"id": 905, "name": "崇左", "parentId": 549, "code": "211400000", "isSelected": false}, {"id": 848, "name": "昌都", "parentId": 555, "code": "260200000", "isSelected": false}], "D": [{"id": 779, "name": "东莞", "parentId": 548, "code": "200300000", "isSelected": false}, {"id": 600, "name": "大连", "parentId": 535, "code": "081700000", "isSelected": false}, {"id": 715, "name": "德州", "parentId": 544, "code": "161600000", "isSelected": false}, {"id": 805, "name": "德阳", "parentId": 552, "code": "231700000", "isSelected": false}, {"id": 841, "name": "大理", "parentId": 554, "code": "250700000", "isSelected": false}, {"id": 577, "name": "大同", "parentId": 533, "code": "061200000", "isSelected": false}, {"id": 706, "name": "东营", "parentId": 544, "code": "162000000", "isSelected": false}, {"id": 815, "name": "达州", "parentId": 552, "code": "230300000", "isSelected": false}, {"id": 627, "name": "大庆", "parentId": 537, "code": "101300000", "isSelected": false}, {"id": 604, "name": "丹东", "parentId": 535, "code": "081300000", "isSelected": false}, {"id": 874, "name": "定西", "parentId": 557, "code": "280400000", "isSelected": false}, {"id": 842, "name": "德宏", "parentId": 554, "code": "250600000", "isSelected": false}, {"id": 107620, "name": "儋州", "parentId": 550, "code": "223300000", "isSelected": false}, {"id": 634, "name": "大兴安岭", "parentId": 537, "code": "100600000", "isSelected": false}], "E": [{"id": 592, "name": "鄂尔多斯", "parentId": 534, "code": "070900000", "isSelected": false}, {"id": 741, "name": "鄂州", "parentId": 546, "code": "181600000", "isSelected": false}, {"id": 748, "name": "恩施", "parentId": 546, "code": "180300000", "isSelected": false}], "F": [{"id": 768, "name": "佛山", "parentId": 548, "code": "202000000", "isSelected": false}, {"id": 681, "name": "福州", "parentId": 542, "code": "140100000", "isSelected": false}, {"id": 674, "name": "阜阳", "parentId": 541, "code": "131000000", "isSelected": false}, {"id": 700, "name": "抚州", "parentId": 543, "code": "150200000", "isSelected": false}, {"id": 607, "name": "阜新", "parentId": 535, "code": "081000000", "isSelected": false}, {"id": 602, "name": "抚顺", "parentId": 535, "code": "081500000", "isSelected": false}, {"id": 790, "name": "防城港", "parentId": 549, "code": "210900000", "isSelected": false}], "G": [{"id": 763, "name": "广州", "parentId": 548, "code": "200100000", "isSelected": false}, {"id": 822, "name": "贵阳", "parentId": 553, "code": "240100000", "isSelected": false}, {"id": 697, "name": "赣州", "parentId": 543, "code": "150500000", "isSelected": false}, {"id": 787, "name": "桂林", "parentId": 549, "code": "211200000", "isSelected": false}, {"id": 814, "name": "广安", "parentId": 552, "code": "230200000", "isSelected": false}, {"id": 792, "name": "贵港", "parentId": 549, "code": "210700000", "isSelected": false}, {"id": 820, "name": "甘孜藏族自治州", "parentId": 552, "code": "230800000", "isSelected": false}, {"id": 807, "name": "广元", "parentId": 552, "code": "231900000", "isSelected": false}, {"id": 877, "name": "甘南", "parentId": 557, "code": "281400000", "isSelected": false}], "H": [{"id": 653, "name": "杭州", "parentId": 540, "code": "120100000", "isSelected": false}, {"id": 664, "name": "合肥", "parentId": 541, "code": "130100000", "isSelected": false}, {"id": 773, "name": "惠州", "parentId": 548, "code": "202500000", "isSelected": false}, {"id": 622, "name": "哈尔滨", "parentId": 537, "code": "100100000", "isSelected": false}, {"id": 799, "name": "海口", "parentId": 550, "code": "220100000", "isSelected": false}, {"id": 587, "name": "呼和浩特", "parentId": 534, "code": "070100000", "isSelected": false}, {"id": 657, "name": "湖州", "parentId": 540, "code": "122200000", "isSelected": false}, {"id": 568, "name": "邯郸", "parentId": 532, "code": "051300000", "isSelected": false}, {"id": 718, "name": "菏泽", "parentId": 544, "code": "160200000", "isSelected": false}, {"id": 575, "name": "衡水", "parentId": 532, "code": "050600000", "isSelected": false}, {"id": 643, "name": "淮安", "parentId": 539, "code": "112500000", "isSelected": false}, {"id": 108353, "name": "海外", "parentId": 108352, "code": "350100000", "isSelected": false}, {"id": 752, "name": "衡阳", "parentId": 547, "code": "191100000", "isSelected": false}, {"id": 737, "name": "黄石", "parentId": 546, "code": "181200000", "isSelected": false}, {"id": 760, "name": "怀化", "parentId": 547, "code": "190300000", "isSelected": false}, {"id": 745, "name": "黄冈", "parentId": 546, "code": "181100000", "isSelected": false}, {"id": 667, "name": "淮南", "parentId": 541, "code": "131400000", "isSelected": false}, {"id": 669, "name": "淮北", "parentId": 541, "code": "131600000", "isSelected": false}, {"id": 776, "name": "河源", "parentId": 548, "code": "201400000", "isSelected": false}, {"id": 724, "name": "鹤壁", "parentId": 545, "code": "171600000", "isSelected": false}, {"id": 860, "name": "汉中", "parentId": 556, "code": "270600000", "isSelected": false}, {"id": 632, "name": "黑河", "parentId": 537, "code": "100800000", "isSelected": false}, {"id": 796, "name": "河池", "parentId": 549, "code": "210300000", "isSelected": false}, {"id": 593, "name": "呼伦贝尔", "parentId": 534, "code": "070800000", "isSelected": false}, {"id": 837, "name": "红河", "parentId": 554, "code": "251100000", "isSelected": false}, {"id": 612, "name": "葫芦岛", "parentId": 535, "code": "080500000", "isSelected": false}, {"id": 672, "name": "黄山", "parentId": 541, "code": "131900000", "isSelected": false}, {"id": 893, "name": "哈密", "parentId": 560, "code": "311400000", "isSelected": false}, {"id": 879, "name": "海东", "parentId": 558, "code": "290200000", "isSelected": false}, {"id": 795, "name": "贺州", "parentId": 549, "code": "210400000", "isSelected": false}, {"id": 881, "name": "黄南", "parentId": 558, "code": "290400000", "isSelected": false}], "J": [{"id": 702, "name": "济南", "parentId": 544, "code": "160100000", "isSelected": false}, {"id": 659, "name": "金华", "parentId": 540, "code": "122400000", "isSelected": false}, {"id": 656, "name": "嘉兴", "parentId": 540, "code": "122100000", "isSelected": false}, {"id": 769, "name": "江门", "parentId": 548, "code": "202100000", "isSelected": false}, {"id": 709, "name": "济宁", "parentId": 544, "code": "162300000", "isSelected": false}, {"id": 782, "name": "揭阳", "parentId": 548, "code": "200600000", "isSelected": false}, {"id": 694, "name": "九江", "parentId": 543, "code": "150800000", "isSelected": false}, {"id": 744, "name": "荆州", "parentId": 546, "code": "181900000", "isSelected": false}, {"id": 582, "name": "晋中", "parentId": 533, "code": "060700000", "isSelected": false}, {"id": 726, "name": "焦作", "parentId": 545, "code": "171800000", "isSelected": false}, {"id": 605, "name": "锦州", "parentId": 535, "code": "081200000", "isSelected": false}, {"id": 692, "name": "景德镇", "parentId": 543, "code": "151000000", "isSelected": false}, {"id": 614, "name": "吉林", "parentId": 536, "code": "091000000", "isSelected": false}, {"id": 629, "name": "佳木斯", "parentId": 537, "code": "101100000", "isSelected": false}, {"id": 580, "name": "晋城", "parentId": 533, "code": "060900000", "isSelected": false}, {"id": 698, "name": "吉安", "parentId": 543, "code": "150400000", "isSelected": false}, {"id": 742, "name": "荆门", "parentId": 546, "code": "181700000", "isSelected": false}, {"id": 866, "name": "金昌", "parentId": 557, "code": "281200000", "isSelected": false}, {"id": 872, "name": "酒泉", "parentId": 557, "code": "280600000", "isSelected": false}, {"id": 107292, "name": "济源", "parentId": 545, "code": "172000000", "isSelected": false}, {"id": 865, "name": "嘉峪关", "parentId": 557, "code": "281300000", "isSelected": false}], "K": [{"id": 831, "name": "昆明", "parentId": 554, "code": "250100000", "isSelected": false}, {"id": 720, "name": "开封", "parentId": 545, "code": "171200000", "isSelected": false}, {"id": 899, "name": "喀什", "parentId": 560, "code": "311100000", "isSelected": false}, {"id": 891, "name": "克拉玛依", "parentId": 560, "code": "311200000", "isSelected": false}], "L": [{"id": 574, "name": "廊坊", "parentId": 532, "code": "050700000", "isSelected": false}, {"id": 864, "name": "兰州", "parentId": 557, "code": "280100000", "isSelected": false}, {"id": 721, "name": "洛阳", "parentId": 545, "code": "171300000", "isSelected": false}, {"id": 714, "name": "临沂", "parentId": 544, "code": "162800000", "isSelected": false}, {"id": 716, "name": "聊城", "parentId": 544, "code": "161500000", "isSelected": false}, {"id": 786, "name": "柳州", "parentId": 549, "code": "211300000", "isSelected": false}, {"id": 642, "name": "连云港", "parentId": 539, "code": "112400000", "isSelected": false}, {"id": 810, "name": "乐山", "parentId": 552, "code": "232200000", "isSelected": false}, {"id": 663, "name": "丽水", "parentId": 540, "code": "122800000", "isSelected": false}, {"id": 677, "name": "六安", "parentId": 541, "code": "130400000", "isSelected": false}, {"id": 585, "name": "临汾", "parentId": 533, "code": "060400000", "isSelected": false}, {"id": 804, "name": "泸州", "parentId": 552, "code": "231600000", "isSelected": false}, {"id": 729, "name": "漯河", "parentId": 545, "code": "171000000", "isSelected": false}, {"id": 689, "name": "龙岩", "parentId": 542, "code": "140400000", "isSelected": false}, {"id": 586, "name": "吕梁", "parentId": 533, "code": "060300000", "isSelected": false}, {"id": 821, "name": "凉山彝族自治州", "parentId": 552, "code": "230900000", "isSelected": false}, {"id": 843, "name": "丽江", "parentId": 554, "code": "250500000", "isSelected": false}, {"id": 847, "name": "拉萨", "parentId": 555, "code": "260100000", "isSelected": false}, {"id": 761, "name": "娄底", "parentId": 547, "code": "190200000", "isSelected": false}, {"id": 823, "name": "六盘水", "parentId": 553, "code": "240200000", "isSelected": false}, {"id": 608, "name": "辽阳", "parentId": 535, "code": "080900000", "isSelected": false}, {"id": 846, "name": "临沧", "parentId": 554, "code": "250200000", "isSelected": false}, {"id": 616, "name": "辽源", "parentId": 536, "code": "090800000", "isSelected": false}, {"id": 108424, "name": "陵水黎族自治县", "parentId": 550, "code": "222700000", "isSelected": false}, {"id": 876, "name": "临夏", "parentId": 557, "code": "280200000", "isSelected": false}, {"id": 853, "name": "林芝", "parentId": 555, "code": "260700000", "isSelected": false}, {"id": 904, "name": "来宾", "parentId": 549, "code": "210200000", "isSelected": false}, {"id": 875, "name": "陇南", "parentId": 557, "code": "280300000", "isSelected": false}], "M": [{"id": 806, "name": "绵阳", "parentId": 552, "code": "231800000", "isSelected": false}, {"id": 812, "name": "眉山", "parentId": 552, "code": "231300000", "isSelected": false}, {"id": 771, "name": "茂名", "parentId": 548, "code": "202300000", "isSelected": false}, {"id": 774, "name": "梅州", "parentId": 548, "code": "202600000", "isSelected": false}, {"id": 668, "name": "马鞍山", "parentId": 541, "code": "131500000", "isSelected": false}, {"id": 631, "name": "牡丹江", "parentId": 537, "code": "100900000", "isSelected": false}], "N": [{"id": 635, "name": "南京", "parentId": 539, "code": "110100000", "isSelected": false}, {"id": 654, "name": "宁波", "parentId": 540, "code": "121900000", "isSelected": false}, {"id": 691, "name": "南昌", "parentId": 543, "code": "150100000", "isSelected": false}, {"id": 785, "name": "南宁", "parentId": 549, "code": "210100000", "isSelected": false}, {"id": 641, "name": "南通", "parentId": 539, "code": "112300000", "isSelected": false}, {"id": 731, "name": "南阳", "parentId": 545, "code": "170300000", "isSelected": false}, {"id": 690, "name": "宁德", "parentId": 542, "code": "140300000", "isSelected": false}, {"id": 811, "name": "南充", "parentId": 552, "code": "232300000", "isSelected": false}, {"id": 809, "name": "内江", "parentId": 552, "code": "232100000", "isSelected": false}, {"id": 688, "name": "南平", "parentId": 542, "code": "140500000", "isSelected": false}], "P": [{"id": 683, "name": "莆田", "parentId": 542, "code": "141000000", "isSelected": false}, {"id": 722, "name": "平顶山", "parentId": 545, "code": "171400000", "isSelected": false}, {"id": 609, "name": "盘锦", "parentId": 535, "code": "080800000", "isSelected": false}, {"id": 727, "name": "濮阳", "parentId": 545, "code": "171900000", "isSelected": false}, {"id": 693, "name": "萍乡", "parentId": 543, "code": "150900000", "isSelected": false}, {"id": 10163, "name": "普洱", "parentId": 554, "code": "251700000", "isSelected": false}, {"id": 803, "name": "攀枝花", "parentId": 552, "code": "231500000", "isSelected": false}, {"id": 871, "name": "平凉", "parentId": 557, "code": "280700000", "isSelected": false}], "Q": [{"id": 703, "name": "青岛", "parentId": 544, "code": "161700000", "isSelected": false}, {"id": 685, "name": "泉州", "parentId": 542, "code": "140800000", "isSelected": false}, {"id": 778, "name": "清远", "parentId": 548, "code": "200200000", "isSelected": false}, {"id": 567, "name": "秦皇岛", "parentId": 532, "code": "051400000", "isSelected": false}, {"id": 832, "name": "曲靖", "parentId": 554, "code": "251600000", "isSelected": false}, {"id": 660, "name": "衢州", "parentId": 540, "code": "122500000", "isSelected": false}, {"id": 623, "name": "齐齐哈尔", "parentId": 537, "code": "101700000", "isSelected": false}, {"id": 791, "name": "钦州", "parentId": 549, "code": "210800000", "isSelected": false}, {"id": 873, "name": "庆阳", "parentId": 557, "code": "280500000", "isSelected": false}, {"id": 108419, "name": "琼海", "parentId": 550, "code": "222200000", "isSelected": false}, {"id": 630, "name": "七台河", "parentId": 537, "code": "101000000", "isSelected": false}, {"id": 830, "name": "黔南", "parentId": 553, "code": "240900000", "isSelected": false}, {"id": 829, "name": "黔东南", "parentId": 553, "code": "240800000", "isSelected": false}, {"id": 827, "name": "黔西南", "parentId": 553, "code": "240600000", "isSelected": false}], "R": [{"id": 712, "name": "日照", "parentId": 544, "code": "162600000", "isSelected": false}, {"id": 850, "name": "日喀则", "parentId": 555, "code": "260400000", "isSelected": false}], "S": [{"id": 6, "name": "上海", "parentId": 2, "code": "020100000", "isSelected": false}, {"id": 765, "name": "深圳", "parentId": 548, "code": "201700000", "isSelected": false}, {"id": 639, "name": "苏州", "parentId": 539, "code": "112100000", "isSelected": false}, {"id": 599, "name": "沈阳", "parentId": 535, "code": "080100000", "isSelected": false}, {"id": 565, "name": "石家庄", "parentId": 532, "code": "050100000", "isSelected": false}, {"id": 767, "name": "汕头", "parentId": 548, "code": "201900000", "isSelected": false}, {"id": 658, "name": "绍兴", "parentId": 540, "code": "122300000", "isSelected": false}, {"id": 648, "name": "宿迁", "parentId": 539, "code": "113000000", "isSelected": false}, {"id": 732, "name": "商丘", "parentId": 545, "code": "170400000", "isSelected": false}, {"id": 800, "name": "三亚", "parentId": 550, "code": "221800000", "isSelected": false}, {"id": 701, "name": "上饶", "parentId": 543, "code": "151100000", "isSelected": false}, {"id": 764, "name": "韶关", "parentId": 548, "code": "201600000", "isSelected": false}, {"id": 675, "name": "宿州", "parentId": 541, "code": "130200000", "isSelected": false}, {"id": 738, "name": "十堰", "parentId": 546, "code": "181300000", "isSelected": false}, {"id": 775, "name": "汕尾", "parentId": 548, "code": "201500000", "isSelected": false}, {"id": 808, "name": "遂宁", "parentId": 552, "code": "232000000", "isSelected": false}, {"id": 753, "name": "邵阳", "parentId": 547, "code": "191000000", "isSelected": false}, {"id": 633, "name": "绥化", "parentId": 537, "code": "100700000", "isSelected": false}, {"id": 747, "name": "随州", "parentId": 546, "code": "180200000", "isSelected": false}, {"id": 730, "name": "三门峡", "parentId": 545, "code": "170200000", "isSelected": false}, {"id": 684, "name": "三明", "parentId": 542, "code": "140900000", "isSelected": false}, {"id": 619, "name": "松原", "parentId": 536, "code": "090500000", "isSelected": false}, {"id": 615, "name": "四平", "parentId": 536, "code": "090900000", "isSelected": false}, {"id": 887, "name": "石嘴山", "parentId": 559, "code": "300200000", "isSelected": false}, {"id": 581, "name": "朔州", "parentId": 533, "code": "060800000", "isSelected": false}, {"id": 108393, "name": "石河子", "parentId": 560, "code": "310500000", "isSelected": false}, {"id": 863, "name": "商洛", "parentId": 556, "code": "270300000", "isSelected": false}, {"id": 849, "name": "山南", "parentId": 555, "code": "260300000", "isSelected": false}, {"id": 108429, "name": "神农架林区", "parentId": 546, "code": "182000000", "isSelected": false}], "T": [{"id": 7, "name": "天津", "parentId": 3, "code": "030100000", "isSelected": false}, {"id": 576, "name": "太原", "parentId": 533, "code": "060100000", "isSelected": false}, {"id": 662, "name": "台州", "parentId": 540, "code": "122700000", "isSelected": false}, {"id": 566, "name": "唐山", "parentId": 532, "code": "051500000", "isSelected": false}, {"id": 647, "name": "泰州", "parentId": 539, "code": "112900000", "isSelected": false}, {"id": 710, "name": "泰安", "parentId": 544, "code": "162400000", "isSelected": false}, {"id": 591, "name": "通辽", "parentId": 534, "code": "071000000", "isSelected": false}, {"id": 826, "name": "铜仁", "parentId": 553, "code": "240500000", "isSelected": false}, {"id": 617, "name": "通化", "parentId": 536, "code": "090700000", "isSelected": false}, {"id": 670, "name": "铜陵", "parentId": 541, "code": "131700000", "isSelected": false}, {"id": 610, "name": "铁岭", "parentId": 535, "code": "080700000", "isSelected": false}, {"id": 868, "name": "天水", "parentId": 557, "code": "281000000", "isSelected": false}, {"id": 108355, "name": "台湾", "parentId": 563, "code": "340100000", "isSelected": false}, {"id": 855, "name": "铜川", "parentId": 556, "code": "271100000", "isSelected": false}, {"id": 107384, "name": "天门", "parentId": 546, "code": "182100000", "isSelected": false}, {"id": 108407, "name": "铁门关", "parentId": 560, "code": "312100000", "isSelected": false}], "W": [{"id": 736, "name": "武汉", "parentId": 546, "code": "180100000", "isSelected": false}, {"id": 636, "name": "无锡", "parentId": 539, "code": "111800000", "isSelected": false}, {"id": 655, "name": "温州", "parentId": 540, "code": "122000000", "isSelected": false}, {"id": 708, "name": "潍坊", "parentId": 544, "code": "162200000", "isSelected": false}, {"id": 665, "name": "芜湖", "parentId": 541, "code": "131200000", "isSelected": false}, {"id": 890, "name": "乌鲁木齐", "parentId": 560, "code": "310100000", "isSelected": false}, {"id": 711, "name": "威海", "parentId": 544, "code": "162500000", "isSelected": false}, {"id": 788, "name": "梧州", "parentId": 549, "code": "211100000", "isSelected": false}, {"id": 858, "name": "渭南", "parentId": 556, "code": "270800000", "isSelected": false}, {"id": 596, "name": "乌兰察布", "parentId": 534, "code": "070500000", "isSelected": false}, {"id": 869, "name": "武威", "parentId": 557, "code": "280900000", "isSelected": false}, {"id": 838, "name": "文山", "parentId": 554, "code": "251000000", "isSelected": false}, {"id": 108423, "name": "万宁", "parentId": 550, "code": "222600000", "isSelected": false}, {"id": 589, "name": "乌海", "parentId": 534, "code": "071200000", "isSelected": false}, {"id": 108425, "name": "文昌", "parentId": 550, "code": "222800000", "isSelected": false}, {"id": 108411, "name": "五家渠", "parentId": 560, "code": "312500000", "isSelected": false}, {"id": 108428, "name": "五指山", "parentId": 550, "code": "223100000", "isSelected": false}], "X": [{"id": 854, "name": "西安", "parentId": 556, "code": "270100000", "isSelected": false}, {"id": 682, "name": "厦门", "parentId": 542, "code": "141100000", "isSelected": false}, {"id": 637, "name": "徐州", "parentId": 539, "code": "111900000", "isSelected": false}, {"id": 725, "name": "新乡", "parentId": 545, "code": "171700000", "isSelected": false}, {"id": 740, "name": "襄阳", "parentId": 546, "code": "181500000", "isSelected": false}, {"id": 569, "name": "邢台", "parentId": 532, "code": "051200000", "isSelected": false}, {"id": 857, "name": "咸阳", "parentId": 556, "code": "270900000", "isSelected": false}, {"id": 105794, "name": "香港", "parentId": 561, "code": "320100000", "isSelected": false}, {"id": 728, "name": "许昌", "parentId": 545, "code": "171100000", "isSelected": false}, {"id": 743, "name": "孝感", "parentId": 546, "code": "181800000", "isSelected": false}, {"id": 878, "name": "西宁", "parentId": 558, "code": "290100000", "isSelected": false}, {"id": 733, "name": "信阳", "parentId": 545, "code": "170500000", "isSelected": false}, {"id": 695, "name": "新余", "parentId": 543, "code": "150700000", "isSelected": false}, {"id": 751, "name": "湘潭", "parentId": 547, "code": "191200000", "isSelected": false}, {"id": 746, "name": "咸宁", "parentId": 546, "code": "181000000", "isSelected": false}, {"id": 680, "name": "宣城", "parentId": 541, "code": "130700000", "isSelected": false}, {"id": 840, "name": "西双版纳", "parentId": 554, "code": "250800000", "isSelected": false}, {"id": 108403, "name": "仙桃", "parentId": 546, "code": "180500000", "isSelected": false}, {"id": 584, "name": "忻州", "parentId": 533, "code": "060500000", "isSelected": false}, {"id": 762, "name": "湘西土家族苗族自治州", "parentId": 547, "code": "191400000", "isSelected": false}, {"id": 594, "name": "兴安盟", "parentId": 534, "code": "070700000", "isSelected": false}, {"id": 595, "name": "锡林郭勒盟", "parentId": 534, "code": "070600000", "isSelected": false}], "Y": [{"id": 707, "name": "烟台", "parentId": 544, "code": "162100000", "isSelected": false}, {"id": 645, "name": "扬州", "parentId": 539, "code": "112700000", "isSelected": false}, {"id": 886, "name": "银川", "parentId": 559, "code": "300100000", "isSelected": false}, {"id": 644, "name": "盐城", "parentId": 539, "code": "112600000", "isSelected": false}, {"id": 813, "name": "宜宾", "parentId": 552, "code": "231200000", "isSelected": false}, {"id": 739, "name": "宜昌", "parentId": 546, "code": "181400000", "isSelected": false}, {"id": 777, "name": "阳江", "parentId": 548, "code": "201300000", "isSelected": false}, {"id": 793, "name": "玉林", "parentId": 549, "code": "210600000", "isSelected": false}, {"id": 754, "name": "岳阳", "parentId": 547, "code": "190900000", "isSelected": false}, {"id": 699, "name": "宜春", "parentId": 543, "code": "150300000", "isSelected": false}, {"id": 583, "name": "运城", "parentId": 533, "code": "060600000", "isSelected": false}, {"id": 606, "name": "营口", "parentId": 535, "code": "081100000", "isSelected": false}, {"id": 861, "name": "榆林", "parentId": 556, "code": "270500000", "isSelected": false}, {"id": 833, "name": "玉溪", "parentId": 554, "code": "251500000", "isSelected": false}, {"id": 757, "name": "益阳", "parentId": 547, "code": "190600000", "isSelected": false}, {"id": 816, "name": "雅安", "parentId": 552, "code": "230400000", "isSelected": false}, {"id": 783, "name": "云浮", "parentId": 548, "code": "200700000", "isSelected": false}, {"id": 578, "name": "阳泉", "parentId": 533, "code": "061100000", "isSelected": false}, {"id": 759, "name": "永州", "parentId": 547, "code": "190400000", "isSelected": false}, {"id": 696, "name": "鹰潭", "parentId": 543, "code": "150600000", "isSelected": false}, {"id": 621, "name": "延边", "parentId": 536, "code": "090300000", "isSelected": false}, {"id": 901, "name": "伊犁", "parentId": 560, "code": "310200000", "isSelected": false}, {"id": 859, "name": "延安", "parentId": 556, "code": "270700000", "isSelected": false}, {"id": 628, "name": "伊春", "parentId": 537, "code": "101200000", "isSelected": false}], "Z": [{"id": 719, "name": "郑州", "parentId": 545, "code": "170100000", "isSelected": false}, {"id": 766, "name": "珠海", "parentId": 548, "code": "201800000", "isSelected": false}, {"id": 780, "name": "中山", "parentId": 548, "code": "200400000", "isSelected": false}, {"id": 704, "name": "淄博", "parentId": 544, "code": "161800000", "isSelected": false}, {"id": 750, "name": "株洲", "parentId": 547, "code": "191300000", "isSelected": false}, {"id": 687, "name": "漳州", "parentId": 542, "code": "140600000", "isSelected": false}, {"id": 770, "name": "湛江", "parentId": 548, "code": "202200000", "isSelected": false}, {"id": 772, "name": "肇庆", "parentId": 548, "code": "202400000", "isSelected": false}, {"id": 646, "name": "镇江", "parentId": 539, "code": "112800000", "isSelected": false}, {"id": 824, "name": "遵义", "parentId": 553, "code": "240300000", "isSelected": false}, {"id": 705, "name": "枣庄", "parentId": 544, "code": "161900000", "isSelected": false}, {"id": 734, "name": "周口", "parentId": 545, "code": "170600000", "isSelected": false}, {"id": 735, "name": "驻马店", "parentId": 545, "code": "170700000", "isSelected": false}, {"id": 571, "name": "张家口", "parentId": 532, "code": "051000000", "isSelected": false}, {"id": 579, "name": "长治", "parentId": 533, "code": "061000000", "isSelected": false}, {"id": 818, "name": "资阳", "parentId": 552, "code": "230600000", "isSelected": false}, {"id": 661, "name": "舟山", "parentId": 540, "code": "122600000", "isSelected": false}, {"id": 870, "name": "张掖", "parentId": 557, "code": "280800000", "isSelected": false}, {"id": 835, "name": "昭通", "parentId": 554, "code": "251300000", "isSelected": false}, {"id": 802, "name": "自贡", "parentId": 552, "code": "231400000", "isSelected": false}, {"id": 756, "name": "张家界", "parentId": 547, "code": "190700000", "isSelected": false}, {"id": 906, "name": "中卫", "parentId": 559, "code": "300500000", "isSelected": false}]}}, "rows": []}}
data/dictStr.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"city": "北京", "name": "范爷"}
data/listStr.json ADDED
@@ -0,0 +1 @@
 
 
1
+ [{"city": "北京"}, {"name": "范爷"}]
data/movie.txt ADDED
File without changes
data/python/347/210/254/350/231/253.png ADDED
data/tmp.png ADDED
gaode.html ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+
4
+ <head>
5
+ <meta name="aplus-core" content="aplus.js">
6
+ <meta name="aplus-waiting" content="MAN">
7
+ <meta charset="UTF-8"/>
8
+ <meta name="data-spm" content="a2l02" />
9
+ <meta name="renderer" content="webkit|ie-comp|ie-stand">
10
+ <meta name="renderer" content="webkit">
11
+ <meta name="baidu-site-verification" content="zyu2elKF1h" />
12
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
13
+
14
+ <meta name="Keywords" content="地图,高德地图,高德地图官网,amap地图,搜索地点,公交查询,驾车导航,中国地图,北京地图,街景地图,团购,优惠信息">
15
+ <meta name="Description" content="高德地图官方网站,提供全国地图浏览,地点搜索,公交驾车查询服务。可同时查看商家团购、优惠信息。高德地图,您的出行、生活好帮手。">
16
+ <meta name="baidu-site-verification" content="code-CsHgD815DF" />
17
+ <meta name="robots" content="noodp">
18
+ <title>
19
+ 高德地图
20
+ </title>
21
+ <link rel="shortcut icon" href="//a.amap.com/pc/static/favicon.ico">
22
+ <style>
23
+ .grey-filter-theme {
24
+ -webkit-filter: grayscale(100%);
25
+ filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
26
+ filter: grayscale(100%);
27
+ filter: gray;
28
+ }
29
+ </style>
30
+ <script type="text/javascript" src="https://a.amap.com/pc/static/config/commonConfig.js"></script>
31
+ <script src="//g.alicdn.com/??AWSC/AWSC/awsc.js,sd/baxia-entry/baxiaCommon.js"></script>
32
+ <script type="text/javascript" src="https://g.alicdn.com/dt/tracker/4.3.1/??tracker.Tracker.js,tracker.interfaceTrackerPlugin.js" crossorigin></script>
33
+ <script type="text/javascript">
34
+
35
+ var tracker = new window.Tracker({
36
+ pid: 'lbs-amap-pc',
37
+ plugins: [
38
+ [window.interfaceTrackerPlugin]
39
+ ],
40
+ });
41
+
42
+ // 启动 tracker 并监听全局 JS 异常
43
+ tracker.install();
44
+ </script>
45
+ <script type="text/javascript">
46
+ window.config = {
47
+ "around": [{
48
+ "key": "meishi",
49
+ "name": "美食",
50
+ "pic": "https://a.amap.com/pc/static/img/meishi.png",
51
+ "picnew": "https://a.amap.com/pc/static/img/search_food.png", "href": ""
52
+ },
53
+ {
54
+ "key": "hotel",
55
+ "name": "酒店",
56
+ "pic": "https://a.amap.com/pc/static/img/hotel.png",
57
+ "picnew": "https://a.amap.com/pc/static/img/search_hotel.png",
58
+ "href": "" },
59
+ {
60
+ "key": "scenic",
61
+ "name": "景点",
62
+ "pic": "https://a.amap.com/pc/static/img/scene.png",
63
+ "picnew": "https://a.amap.com/pc/static/img/search_view.png",
64
+ "href": ""
65
+ },
66
+ {
67
+ "key": "cinema",
68
+ "name": "小区",
69
+ "pic": "https://a.amap.com/pc/static/img/residence.png",
70
+ "picnew": "https://a.amap.com/pc/static/img/search_house.png",
71
+ "href": ""
72
+ }],
73
+ "lushu_link": {
74
+ "link1": "http://lbsbbs.amap.com/forum.php?mod=forumdisplay&fid=60",
75
+ "link2": "http://lbsbbs.amap.com/forum.php?mod=viewthread&tid=22920&extra=page%3D1",
76
+ "link3": "javascript:void(0)"
77
+ },
78
+ "mapCode": "GS(2019)6379号",
79
+ "jiace": "甲测资字11002004",
80
+ "amapBeian": "<a href='https://beian.miit.gov.cn' target='_blank'>京ICP备07017245号-2</a>",
81
+ "gaodeBeian": "<a href='https://beian.miit.gov.cn' target='_blank'>京ICP备07017245号-7</a>",
82
+ "anbei": " - <span><a target='_blank' style='color:#565656' href='http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010502030880'><img style='margin-bottom:1px' src='/assets/img/beian.png' />京公网安备 11010502030880号</a></span>",
83
+ "jubao": " | 未成年人举报邮箱:gd.wcn.jubao@service.autonavi.com",
84
+ "satelliteCode": "GS(2021)1328号 - Image© DigitalGlobe&spaceview",
85
+ "placeholder": "搜索位置、公交站、地铁站",
86
+ "yunqiBanner": false,
87
+ "activebanner": [{
88
+ "imgurl": "https://a.amap.com/pc/static/img/spring_transport.png",
89
+ "show": false,
90
+ "target" : "_blank",
91
+ "jumpurl": "http://chunyun.itsc.cn",
92
+ "trace": "springtransport"
93
+ }]
94
+ };
95
+ </script>
96
+ <script type="text/javascript">
97
+ if (/mobile/i.test(navigator.userAgent) && !/ipad/i.test(navigator.userAgent) && location.pathname !== '/jumpm') {
98
+ //m站参数
99
+ var exchangepath = location.pathname + location.search + location.hash;
100
+
101
+ if(exchangepath.indexOf('platform=pc') < 0){
102
+ location.href = "https://m.amap.com?amapexchange=" + encodeURIComponent(exchangepath);
103
+ }
104
+
105
+ }
106
+
107
+ if (!document.all) { //IE11 or other
108
+ //HireInfo
109
+ } else { //IE6-10
110
+
111
+ if (window.navigator.appName !== 'Microsoft Internet Explorer') {
112
+ //非IE
113
+ } else {
114
+
115
+ var mode = 5;
116
+
117
+ if (document.documentMode) {
118
+ mode = document.documentMode;
119
+ } else if (document.compatMode) {
120
+ if (document.compatMode === 'CSS1Compat') {
121
+ mode = 7;
122
+ }
123
+ }
124
+
125
+ var rv = -1,
126
+ ua = navigator.userAgent;
127
+ var re = new RegExp('MSIE ([0-9]{1,}[\\.0-9]{0,})');
128
+ if (re.exec(ua) !== null) {
129
+ rv = parseFloat(RegExp.$1);
130
+ }
131
+
132
+ var v = 11;
133
+
134
+ //IE11
135
+ if (mode < v || rv < v) {
136
+ location.href = "http://map.amap.com";
137
+ }
138
+
139
+ }
140
+ }
141
+
142
+ window.Tracker = {fht: Date.now(), fpt: window.performance && performance.now() || Date.now(),aid: 2, percent: 100, rt: {}};
143
+ var _czc = _czc || [];
144
+ _czc.push(["_setAutoPageview", false]);
145
+ var _t = Date.now();
146
+ var startTime = new Date();
147
+
148
+ window.__WPO = {
149
+ config: {
150
+ // sample: 1,
151
+ // spmId: 'a2l02',
152
+ // dynamic: false
153
+ }
154
+ };
155
+ __WPO.speed = function () {};
156
+ __WPO.custom = function () {};
157
+
158
+ // aes_config
159
+ window.AES_CONFIG = window.AES_CONFIG || {};
160
+
161
+ AES_CONFIG.pid = 'amap-pc';
162
+ AES_CONFIG.user_type = '101';
163
+ AES_CONFIG.uid = '';
164
+ AES_CONFIG.username = '';
165
+
166
+ </script>
167
+
168
+
169
+ <style type='text/css'>
170
+ /*! normalize.css v3.0.2 | MIT License | git.io/normalize */body,html{width:100%;height:100%}html,svg:not(:root){overflow:hidden}img,legend{border:0}body,legend,ol,td,th,ul{padding:0}body,h1,h2,h3,h4,h5,ol,p,ul{margin:0}#citybox .air-quality:hover,#layerbox_item .item:hover{opacity:.6}html{font-family:Arial,sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{font-size:12px;line-height:1.5;color:#565656;word-wrap:break-word}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent;color:#0f89f5;text-decoration:none}a:active,a:hover{outline:0;text-decoration:underline}abbr[title]{border-bottom:1px dotted}b,optgroup,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{vertical-align:middle}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;outline:0}input::-ms-clear{display:none}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}.layerbox,.tooldragbar{position:absolute;cursor:move}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#amap-banner,#amap-banner-entry,#nav li,.city-pc-title span,.city-search input,.searchbox{box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}table{border-collapse:collapse;border-spacing:0}ol,ul{list-style:none}h1,h2,h3,h4,h5{font-weight:400}.amap-copyright{display:none;padding:0 4px;margin-bottom:4px;background:rgba(255,255,255,.6)}.amap-copyright.copyright_theme{background:rgba(0,0,0,.5);color:#fff}@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_110978_4497r7w1cgt.eot);src:url(//at.alicdn.com/t/font_110978_4497r7w1cgt.eot?#iefix) format('embedded-opentype'),url(//at.alicdn.com/t/font_110978_4497r7w1cgt.woff2) format('woff2'),url(//at.alicdn.com/t/font_110978_4497r7w1cgt.woff) format('woff'),url(//at.alicdn.com/t/font_110978_4497r7w1cgt.ttf) format('truetype'),url(//at.alicdn.com/t/font_110978_4497r7w1cgt.svg#iconfont) format('svg')}.iconfont{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-bfe:before{content:"\e658"}.icon-select:before{content:"\e657"}.icon-copylushu:before{content:"\e656"}.icon-icon-xinzenglushu:before{content:"\e655"}.icon-liebiao:before{content:"\e653"}.icon-shupingguangchang:before{content:"\e654"}.icon-iconfontzanxuanzhong:before{content:"\e6b3"}.icon-fabu:before{content:"\e650"}.icon-shaixuan:before{content:"\e652"}.icon-book:before{content:"\e64f"}.icon-cuxiao-s:before{content:"\e64e"}.icon-tuichu:before{content:"\e6a3"}.icon-duihao:before{content:"\e64d"}.icon-theme1:before{content:"\e66f"}.icon-theme:before{content:"\e65f"}.icon-wumai:before{content:"\e644"}.icon-tel:before{content:"\e64c"}.icon-rmb:before{content:"\e64a"}.icon-alipay:before{content:"\e648"}.icon-hui:before{content:"\e649"}.icon-tuan:before{content:"\e659"}.icon-caretup:before{content:"\e65b"}.icon-caretdown:before{content:"\e64b"}.icon-sortdown:before{content:"\e728"}.icon-sortup:before{content:"\e72a"}.icon-thlarge:before{content:"\e647"}.icon-circle:before{content:"\e675"}.icon-angleleft:before{content:"\e646"}.icon-star-o:before{content:"\e7bf"}.icon-chevronleft:before{content:"\e6e7"}.icon-chevronright:before{content:"\e6e8"}.icon-image:before{content:"\eb26"}.icon-map-marker:before{content:"\e6ea"}.icon-weixin2:before{content:"\e643"}.icon-weixin1:before{content:"\e645"}.icon-weixin:before{content:"\e68b"}.icon-icon-sina:before{content:"\e694"}.icon-qqkongjian:before{content:"\e65d"}.icon-add:before{content:"\e642"}.icon-kongjian:before{content:"\e682"}.icon-sina:before{content:"\e641"}.icon-qixing:before{content:"\e697"}.icon-icon:before{content:"\e651"}.icon-buxingyixuan:before{content:"\e669"}.icon-gongjiao:before{content:"\e640"}.icon-mai:before{content:"\e63f"}.icon-icon-v:before{content:"\e68f"}.icon-time:before{content:"\e74c"}.icon-wentidewen:before{content:"\e63b"}.icon-bookfood:before{content:"\e63c"}.icon-bookground:before{content:"\e63d"}.icon-bookrailway:before{content:"\e63e"}.icon-iconjia:before{content:"\e63a"}.icon-bookgoto:before{content:"\e639"}.icon-booklistpoi:before{content:"\e638"}.icon-bookairport:before{content:"\e637"}.icon-bookplane:before{content:"\e74d"}.icon-bookhotel:before{content:"\e633"}.icon-bookmall:before{content:"\e634"}.icon-bookheart:before{content:"\e635"}.icon-bookpark:before{content:"\e636"}.icon-bookedit:before{content:"\e631"}.icon-booksite:before{content:"\e632"}.icon-booksync:before{content:"\e630"}.icon-bookoverview:before{content:"\e62f"}.icon-bookauto:before{content:"\e62c"}.icon-bookback:before{content:"\e62d"}.icon-bookbubble:before{content:"\e62e"}.icon-mianxingtubiao1luxian:before{content:"\e62a"}.icon-qiche:before{content:"\e62b"}.icon-cloud-up:before{content:"\e629"}.icon-clear:before{content:"\e628"}.icon-iconbianji:before{content:"\e627"}.icon-iconshoucangjia:before{content:"\e626"}.icon-icontuichu:before{content:"\e625"}.icon-lushu:before{content:"\e61b"}.icon-satellite:before{content:"\e61c"}.icon-livephoto:before{content:"\e61d"}.icon-traffic:before{content:"\e61e"}.icon-fullscreen:before{content:"\e61f"}.icon-more:before{content:"\e620"}.icon-ranging:before{content:"\e621"}.icon-subway:before{content:"\e622"}.icon-check:before{content:"\e623"}.icon-exit:before{content:"\e624"}.icon-icontianjia:before{content:"\e61a"}.icon-iconrili:before{content:"\e619"}.icon-iconlajitong:before{content:"\e617"}.icon-iconzhiding:before{content:"\e618"}.icon-icontishibaocuo:before{content:"\e616"}.icon-icontishixinxi:before{content:"\e615"}.icon-iconduihao:before{content:"\e614"}.icon-iconfenxiang:before{content:"\e613"}.icon-history:before{content:"\e609"}.icon-downarrow:before{content:"\e60a"}.icon-arrowup:before{content:"\e60b"}.icon-magnifer:before{content:"\e60c"}.icon-delete:before{content:"\e60d"}.icon-switchroute:before{content:"\e60e"}.icon-whytip:before{content:"\e60f"}.icon-clearmap:before{content:"\e610"}.icon-mapcenter:before{content:"\e611"}.icon-where:before{content:"\e612"}.icon-close:before{content:"\e603"}.icon-buss:before{content:"\e604"}.icon-cars:before{content:"\e605"}.icon-poi:before{content:"\e606"}.icon-poi2:before{content:"\e607"}.icon-search:before{content:"\e608"}.icon-star:before{content:"\e600"}.icon-nearby:before{content:"\e601"}.icon-phone:before{content:"\e602"}.layerbox{top:15px;left:calc(100% - 385px);z-index:1999;background:#fff;border-radius:1px;box-shadow:0 2px 2px rgba(0,0,0,.15)}.tooldragdown,.tooldragup{height:10px;width:100%;left:0}.tooldragup{top:-5px}.tooldragdown{bottom:-5px}.tooldragleft,.tooldragright{height:100%;width:12px;top:0}.tooldragleft{left:-6px}.tooldragright{right:-6px}#layerbox{background:#fff;z-index:112;-webkit-border-radius:1px;-moz-border-radius:1px;-o-border-radius:1px;border-radius:3px}#layerbox_item{padding:14px 0 13px;background:#fff;border-radius:3px;height:18px}#layerbox_item .show-list{position:relative}#layerbox_item .show-list .red-point{display:none;width:4px;height:4px;background-color:red;border-radius:4px;position:absolute;top:0;left:122px;border:1px solid red;z-index:100}#layerbox_item .item{float:left;height:18px;padding:0 12px;font-size:12px;border-left:1px #dbdee2 dashed;vertical-align:middle;cursor:pointer;overflow:visible;zoom:1;color:#5f6477}#amap-panels,.ellipsis,.select_time,.select_week,body{overflow:hidden}#layerbox_item .item.no_border{border:0}#layerbox_item .item:first-child,#layerbox_item i+.item{border-left:0}#layerbox_item .item span{display:inline-block;vertical-align:middle;float:left}#layerbox_item .item .name{line-height:18px}#layerbox_item .item .icon{width:20px;height:18px;line-height:18px;margin-right:6px;color:#7c8196}#layerbox_item .item .icon .iconfont{width:20px;height:18px;line-height:18px;font-size:18px}#layerbox_item .item .icon .iconfont.icon-wumai{font-weight:700}#layerbox_item .item .icon .icon-livephoto,#layerbox_item .item .icon .icon-ranging{font-size:20px}#layerbox_item .item.active{color:#009cf9}#layerbox_item .item.active .iconfont{color:#2c9eff}#layerbox_item .item.smog .icon{cursor:pointer;background-position:0 -239px}#layerbox_item .smog.active .icon{background-position:0 -288px}#layerbox_item .item.traffic .icon{background-position:2px -140px}#layerbox_item .traffic.active .icon{background-position:2px -175px}#layerbox_item .pano .icon{background-position:11px -53px}#layerbox_item .pano.active .icon{background-position:11px -82px}#layerbox_item .ranging .icon{background-position:2px -423px}#layerbox_item .ranging.active .icon{background-position:2px -458px}#layerbox_item .satellite .icon{background-position:4px 1px}#layerbox_item .satellite.active .icon{background-position:4px -34px}#layerbox_item .lushu.active .icon{background:url(/assets/img/tools_img/icon_lushu_select.png) left center no-repeat}#layerbox_item .livephoto .icon{background-position:2px -70px}#layerbox_item .livephoto.active .icon{background-position:2px -106px}#layerbox_item .subway .icon{background-position:3px -493px}#layerbox_item .subway.active .name{color:#565656}#layerbox_item .pm25 .icon{background-position:11px -168px}#layerbox_item .pm25.active .icon{background-position:11px -197px}#layerbox_item .faves .icon{background-position:2px -565px}#layerbox_item .faves.active .icon{background-position:2px -601px}#layerbox_item .item.more_item{position:relative}#layerbox_item .item.more_item>.icon{text-align:center;background-position:2px -210px}#layerbox_item .item.more_item.active .icon{background-position:2px -246px}#layerbox_item .roadnet{position:absolute;opacity:0;padding:13px 0;z-index:-1;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px;left:-84px;top:0;background:#fff;box-shadow:1px 2px 1px rgba(0,0,0,.15);cursor:pointer;display:none}#layerbox_item .roadnet .raod_item{height:19px;line-height:19px;color:#565656;font-size:12px;display:inline-block;padding:0 10px;vertical-align:middle;cursor:pointer}#layerbox_item .hide-list{position:absolute;display:none;top:49px;right:66px;background-color:#fff;padding:0 6px 8px;z-index:3;box-shadow:1px 1px 1px rgba(0,0,0,.15);-webkit-border-radius:1px;-moz-border-radius:1px;-o-border-radius:1px;border-radius:1px;border:1px solid #ddd}#layerbox_item .hide-list .item{background-color:#fff;display:inline-block;border-right:0;padding:13px 0 4px;width:46px;height:auto;text-align:center;float:left;color:#565656}#layerbox_item .hide-list .item .icon-c{width:32px;height:32px;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;border:1px solid #eaeaea;text-align:center}#layerbox_item .hide-list .item .icon-c .icon{margin:6px 0 0 1px}#layerbox_item .hide-list .item .name{margin-top:4px}#layerbox_item .boxpanel{position:absolute;top:58px;right:0;width:310px;background:#FFF;border-radius:3px}.roadnet .roadnet_select_icon{display:inline-block;vertical-align:middle;background:url(/assets/img/tools_layer_new.png?v=2) 0 -434px no-repeat;width:22px;height:20px;margin-right:5px}.roadnet.checked .roadnet_select_icon{background-position:0 -483px}.traffic_level{float:left;margin:11px 6px 0}.traffic_level li{float:left;width:25px;margin:0 1px;height:6px}.traffic_level li.level_1{background:#34b000}.traffic_level li.level_2{background:#fecb00}.traffic_level li.level_3{background:#df0100}.traffic_level li.level_4{background:#8e0e0b}.traffic_wrap .time_lbl{color:#999}.traffic_wrap .date,.traffic_wrap .week{padding:0 6px}.select_week{margin:20px 0 10px;zoom:1}.select_week .time_lbl,.select_week .time_week{float:left}.select_week .time_week li{float:left;margin-left:20px;cursor:pointer}.select_week .time_week li.select{color:#0f89f5}.select_time{zoom:1}.select_time .time_lbl{float:left;line-height:42px}.select_time .time_time{float:left;width:252px;height:42px;margin-left:20px;background:url(/assets/img/time_select.png) 0 -28px no-repeat}.select_time .time_drag{height:30px;margin:0 auto}.ranged{line-height:0;position:relative;width:244px;top:14px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}#amap-banner,#amap-banner-entry,#amapbox,#maptoolbox,.mainbox,.ranged-thumb,.thumb-time-wrap,.thumb-time-wrap .thumb-time{position:absolute}.icon-add,.icon-reduce,.unselected,.usel{-webkit-user-select:none;-moz-user-select:none;-o-user-select:none}.ranged-bar{display:inline-block;height:100%}.ranged-thumb{display:inline-block;height:19px;width:11px;background:url(/assets/img/time_select.png) -1px -1px no-repeat;outline:0;margin-left:-5px;cursor:pointer}#locbox,#scalebox{background:#fff;border-radius:3px}.thumb-time-wrap{font-size:12px;top:-6px;left:-100%;color:#0f89f5}#indexbox .relative,#themap,body{position:relative}#maptoolbox{left:calc(100% - 48px);top:calc(100% - 132px);height:122px}#maptoolbox .dragtop{cursor:move;top:-10px;left:0;height:10px;width:100%}#maptoolbox .dragbottom{cursor:move;bottom:-10px;left:0;height:10px;width:100%}#maptoolbox .dragleft{cursor:move;top:0;left:-10px;width:10px;height:100%}#maptoolbox .dragright{cursor:move;right:-10px;top:0;width:10px;height:100%}#locbox{width:33px;height:33px;cursor:pointer}#locbox .locating{padding:8.5px;width:16px;height:16px}#locbox .locicon .icon{width:17px;height:17px;padding:8px;fill:#646464;cursor:pointer}#locbox .locicon.locok .icon{fill:#0091ff}#scalebox{width:29px;height:73px;margin-top:16px;padding:0 2px}#scalebox .zoom_map{width:24px;height:16px;margin:0 auto;padding:10px 0;background:url(/assets/img/scale.png) no-repeat;cursor:pointer}#scalebox .zoom_map.zoom_in_map{border-bottom:1px #dfdfdf solid;background-position:-3px 3px}#scalebox .zoom_map.zoom_out_map{background-position:-3px -156px}#scalebox .zoom_map.zoom_unable{background:url(/assets/img/scale_unable.png) no-repeat;cursor:default}#scalebox .zoom_in_map.zoom_unable{background-position:-3px 3px}#scalebox .zoom_out_map.zoom_unable{background-position:-3px -156px}#locTip .jBox-container,#locTip .jBox-pointer:after{background:rgba(0,0,0,.8)}.loc_tip .loc_tip_title{color:#fff}.amap-controls .amap-indoormap-floorbar-control{right:19px!important}.amap-controlbar{transform:scale(.7);bottom:130px!important;right:-7px!important}.sufei-dialog-close{display:none}.icon-add,.icon-reduce,.unselected{-khtml-user-select:none;user-select:none}.ellipsis{text-overflow:ellipsis;white-space:nowrap;display:inline-block}#indexbox .blue{color:#0f89f5}#indexbox .none{display:none}#indexbox button,.button{line-height:normal;background-color:#559ffb;border:none;border-radius:2px;color:#FFF;font-size:14px}.transit{-webkit-transition:all .2s;-moz-transition:all .2s;-o-transition:all .2s;transition:all .2s}.flex{display:-webkit-box;display:-moz-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex}.zdeps-1{box-shadow:0 2px 2px rgba(0,0,0,.15)}.zdeps-2{-webkit-box-shadow:0 2px 6px 0 rgba(0,0,0,.2),0 2px 6px 0 rgba(0,0,0,.19);-moz-box-shadow:0 2px 6px 0 rgba(0,0,0,.2),0 2px 6px 0 rgba(0,0,0,.19);box-shadow:0 2px 6px 0 rgba(0,0,0,.2),0 2px 6px 0 rgba(0,0,0,.19)}.zdeps-3{box-shadow:1px -1px 6px rgba(0,0,0,.3)}.usel{-ms-user-select:none;user-select:none}.sep{display:inline-block;vertical-align:baseline;border-right:1px solid #e1e1e1;height:12px;margin:0 4px}.clearfix:after{content:'\0020';display:block;height:0;clear:both}body{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACu5JREFUeNrs3MGN4lAQBFB7IyMzTGZkxmImAdNqfRWt9yTf+jKuQ8lIU9vr9douPIe7JXcv70Ue7uQhD3eVPP5tAMDPU+gAoNABAIUOACh0AEChA4BCBwAUOgDQaD//ad1riHF/Pw+vQR7IQx58nYfFHctL7uQhD3fysBQHAARQ6ACg0AEAhQ4AKHQAQKEDgEIHABQ6ANDIUlwW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QAQCFDgAKHQBQ6ADAIktxWSwvyQN5yINRHpbisu4sL8nDnTzk4W6Uhyd3ACig0AFAoQMACh0AUOgAgEIHAIUOACh0AGDRsRR39xkA4L39E2AAdhk/ILAOHTMAAAAASUVORK5CYII=)!important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}#search-panel:after{content:'';position:absolute;bottom:0;left:0;width:400px;height:2em;background:linear-gradient(rgba(255,255,255,0),rgba(255,255,255,1));pointer-events:none;z-index:99999}#themap.amap-container{background:0 0}#themap.themap_theme{background-image:none!important}.mainbox{left:15px;top:15px;z-index:2001}#amapbox{z-index:2000;left:15px;top:66px;width:400px;display:none}#amap-panels{background:#fff;position:relative;width:100%;opacity:.94}#amap-banner-entry{left:0;bottom:0;width:56px;height:66px;border-top:1px solid transparent;background:url(/assets/img/sqrcode2.png) 8px 10px no-repeat;cursor:pointer;z-index:1010}#amap-banner-entry:hover{background-color:#fff;border-top:1px solid #f4f5f6}#amap-banner-entry:hover #amap-banner{display:block}#amap-banner{display:none;z-index:1008;bottom:0;left:55px;background:#fff}#alibaba{display:none;text-align:center;margin:8px 8px 2px;color:#999}#mobileenterance{position:relative;background:url(/assets/img/amap_banner.png?v=3) center center no-repeat;width:344px;height:100px;border:1px solid #f4f5f6}#mobileenterance_no_bg{position:relative;background:url(/assets/img/app_banner.png) 96px center no-repeat #fbfbfb;background-size:160px 65px;height:95px}#mobileenterance a,#mobileenterance_no_bg a{position:absolute;color:#333;right:22px;width:70px;height:20px;text-align:center;line-height:20px;text-decoration:none;border-radius:3px;cursor:pointer}#mobileenterance .bannerQrcode,#mobileenterance_no_bg .bannerQrcode{vertical-align:middle;position:absolute;width:65px;height:65px;top:15px;left:22px}.app_banner{position:absolute;width:160px;height:65px;top:16px;left:96px}.amap-panctrl,.amap-search-panctrl{z-index:-10;position:absolute;height:24px;left:0;display:none;cursor:pointer;overflow:hidden;text-align:center}#mobileenterance .android,#mobileenterance_no_bg .android{bottom:20px;color:#6ccfaf;border:1px solid #6ccfaf}#mobileenterance .android:hover,#mobileenterance_no_bg .android:hover{background-color:#6ccfaf;color:#fff}#mobileenterance .ios,#mobileenterance_no_bg .ios{top:20px;color:#8c989f;border:1px solid #8c989f}#citybox,#citybox .city-title{border-bottom-left-radius:3px}#mobileenterance .ios:hover,#mobileenterance_no_bg .ios:hover{background-color:#8c989f;color:#fff}.amap-panctrl{width:100%;background:url(/assets/img/panctrl.png) center center no-repeat}.amap-search-panctrl{background-color:#fff;padding:12px 10px 5px;width:340px;font-size:14px;box-shadow:1px 2px 1px rgba(0,0,0,.1);color:#0f89f5}#citybox,#citybox .weather-box{box-shadow:0 2px 2px rgba(0,0,0,.15);position:absolute;background:#fff}.amap-panctrl-down,.amap-panctrl-up{bottom:-20px}.amap-panctrl .fa{padding:2px 40px}.amap-panctrl .fa:hover{color:#0091ff}#citybox{top:15px;left:395px;z-index:1100;border-top-left-radius:3px;color:#5f6477}#citybox .city-title{padding:14px 8px;background:#fff;cursor:pointer;display:inline-block;min-width:36px;height:17px;border-top-left-radius:3px}#citybox .city-title .iconfont{font-size:12px;display:inline-block}#citybox .city-title.active,#citybox .city-title:hover{color:#0091ff}#citybox .city-title.active .iconfont{-webkit-transform:rotate(-180deg);-moz-transform:rotate(-180deg);-ms-transform:rotate(-180deg);transform:rotate(-180deg)}#citybox .city-panel{z-index:1999;top:48px;left:0}#layerbox .city-panel{display:none;z-index:1999;top:38px;right:-6px}#citybox .weather-box{display:inline-block;text-align:center;height:45px;z-index:-1;top:0;border-bottom-right-radius:3px;border-top-right-radius:3px}#citybox .weather-item{display:inline-block;vertical-align:middle}#citybox .weather-info{padding:6px 8px 0 10px;margin-top:-1px;display:none;white-space:nowrap}#citybox .weather-info img.fa-spin{margin:10px 0}#citybox .air-quality{font-size:13px;cursor:pointer;padding-right:5px;margin-left:3px}#citybox .air-quality.active{color:#009cf9}#citybox .air-quality .icon-wumai{font-size:24px;vertical-align:middle;padding-left:10px;border-left:1px dashed #000}#exitFullscreen,.exitLushu{padding:0 14px;box-shadow:1px 2px 1px rgba(0,0,0,.15)}#exitFullscreen{position:absolute;top:15px;right:15px;line-height:46px;height:46px;color:#565656;font-size:13px;z-index:1100;background:#fff;border-radius:3px;cursor:pointer;display:none}#exitFullscreen:hover{color:rgba(109,120,145,.6)}.exitLushu,.lushu_fb_qa a{color:#5f6477;cursor:pointer}.lushu_ctrl{position:absolute;top:15px;right:90px;display:none}.lushu_fb_qa{background:#fff;border-radius:3px;float:left;margin-right:12px;box-shadow:1px 2px 1px rgba(0,0,0,.15)}.lushu_fb_qa a{display:block;float:left;height:46px;width:46px;font-size:13px;text-align:center;background-size:50%;background-repeat:no-repeat;background-position:center}.exitLushu span,.lushu_fb_qa a span{display:inline-block}.lushu_fb_qa a.lushu_fb{background-image:url(/assets/img/icon_feedback.png)}.lushu_fb_qa a.lushu_qa{background-image:url(/assets/img/icon_help.png)}.lushu_fb_qa a.lushu_intro{background-image:url(/assets/img/icon_intro.png);background-size:45%}.lushu_fb_qa a span{height:28px;width:46px;border-right:1px #d5dce0 dashed;line-height:28px;margin-top:9px;text-indent:-999px;overflow:hidden}.exitLushu,.exitLushu span{height:46px;line-height:46px;float:left}.lushu_fb_qa a:last-child{margin-left:1px}.lushu_fb_qa a:last-child span{border:0}.lushu_fb_qa a:hover{text-decoration:none;background:#f8f8f8}.lushu_fb_qa a:hover span{text-indent:0}.exitLushu{border-radius:3px;background:#fff}.exitLushu span .iconfont{font-size:20px;margin-right:6px}.loc_icon{width:16px;height:16px;border:2px solid #fff;background-color:#0f89f5;-moz-border-radius:50%;-webkit-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;box-shadow:2px 2px 2px rgba(0,0,0,.15)}.ripple{position:relative;width:40px;height:40px}.ripple i{position:absolute;top:50%;left:50%;border-radius:50%;background:#fff;opacity:0}#amap-panels>div,#layerbox1,#nav li{position:relative}#amap-result-banner{margin:0 auto}#amap-result-banner #mobileenterance{width:315px;border:1px solid #f4f5f6}#amap-result-banner .active-banner img{height:97px;width:100%}#amap-panels>div{display:none;background:#fff;width:100%}#amap-links,#nav{position:absolute;overflow:hidden}#amap-links{z-index:1002;width:345px;bottom:0;right:0;background:#fff;text-align:center;border-top:1px solid #f4f4f4}#amap-links>a{color:#999;display:inline-block;padding:6px}#nav{width:55px;background-color:#f4f5f6;height:100%;z-index:9999}#nav li{width:55px;height:55px;padding-top:7px;text-align:center;cursor:pointer}#nav li .fa{font-size:20px;color:#b1b2b3;display:block}#nav li .nav-txt{font-size:12px;line-height:12px;height:12px;color:#737475}#nav .active .dirico,#nav .dirico,#nav li:hover .dirico{width:18px;height:20px;margin:0 18.5px;display:inline-block}#nav li.active,#nav li:hover{background-color:#fff}#nav li.active .fa,#nav li.active .nav-txt,#nav li:hover .fa,#nav li:hover .nav-txt{color:#1b8cfb}#nav .dirico{background:url(/assets/img/indexicon/dir.png) center center no-repeat}#nav .active .dirico,#nav li:hover .dirico{background:url(/assets/img/indexicon/dir-active.png) center center no-repeat}#nav .starico{display:inline-block;width:21px;height:21px;margin:0 17px;background:url(/assets/img/favstar.png) no-repeat;overflow:hidden}#layerbox .hide-list .item.smog,.boxpanel{display:none}#nav .active .starico,#nav li:hover .starico{background-position:-21px 0}body .is-dragging{z-index:199999}.boxpanel{padding:12px}.boxpanel .panel_header{height:30px}.boxpanel .panel_body{margin-top:10px}.boxpanel .panel_header .panel_tab{float:left;height:28px;line-height:28px;border:1px solid #0f89f5;border-radius:2px}.boxpanel .panel_header .panel_tab li{float:left;padding:0 10px;color:#0f89f5;font-size:14px;cursor:pointer}.boxpanel .panel_header .panel_tab li.active{background:#0f89f5;color:#FFF}.boxpanel .panel_header .traffic_tag{float:right;line-height:30px}.boxpanel .panel_header .traffic_tag span{float:left;font-size:14px}#layerbox1{float:right;width:90px;background:#FFF;border-radius:2px}#layerbox1 .layer_item1{line-height:30px;text-align:right;padding:0 2px;cursor:pointer;width:90px;background:url(/assets/img/tools_layer_new.png) no-repeat #FFF;position:absolute}#layerbox1 .layer_item1 span{padding-right:10px}#layerbox1 .layer_item1 .roadnet{display:none;border-top:1px #e5e5e5 solid;background:url(/assets/img/tools_layer_new.png) 7px -280px no-repeat #fff}#layerbox1 .layer_item1 .roadnet.select{background-position:7px -305px}#layerbox1 .layer_item1 .layer_mask{position:absolute;top:0;left:0;width:100%;height:100%;background:#000;opacity:.2}#layerbox1 .layer_item1.two_d{background-position:2px -220px}#layerbox1 .layer_item1.three_d{background-position:2px -249px}#layerbox1 .layer_item1.up{z-index:3}#layerbox1 .layer_item1.down{z-index:2}#toolbox{position:absolute;bottom:10px;right:100px;z-index:1999;background:#fff;border-radius:2px;height:30px}.ranging .icon{background-position:11px 2px}.ranging.active .icon{background-position:11px -121px}.mark .icon{background-position:10px -22px}.screenshot .icon{background-position:11px -46px}#layerbox .fullscreen.notfull .icon{border:0;background-position:2px -282px}#layerbox .fullscreen.full .icon{border:0;background-position:0 -320px}.flipY{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.flyme{position:absolute;z-index:100000;font-size:18px;color:#4787ed}.loc_edit{color:#3a84df}#loginTip .jBox-pointer-bottom:after{bottom:8px;left:10px}#loginTip.login-tip-hide{display:none!important}.recommend_entry{display:none;position:absolute;width:230px;height:252px;background:url(/assets/img/lushu_entry.png) #4a90e2;background-size:230px 252px;right:0;top:58px;border-radius:3px;box-shadow:1px 2px 1px rgba(0,0,0,.15);cursor:pointer}.recom_close{position:absolute;width:24px;height:24px;top:6px;right:8px;z-index:10;color:#fff;cursor:pointer;text-align:center}.recommend_entry:before{content:"";position:absolute;top:-4px;right:18px;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #4a90e2;border-top:0}.amap-scalecontrol.scalecontrol_theme{color:#fff}.city-default,.city-panel-close:hover{color:#0f89f5}.fav_marker_outer{position:absolute;width:16px;height:16px;margin-top:-8px;margin-left:-8px;z-index:-10}.citypicker-autocomplete-suggestions{border:1px solid #e1e1e1;background:#FFF;overflow:auto}.citypicker-autocomplete-suggestions .autocomplete-suggestion{padding:2px 5px;white-space:nowrap;overflow:hidden;background:#fff;text-indent:0}.citypicker-autocomplete-suggestions .autocomplete-selected{background:#f1f1f1}.citypicker-autocomplete-suggestions strong{font-weight:400;color:#0f89f5}.citypicker-autocomplete-suggestions .autocomplete-group{padding:2px 5px}.citypicker-autocomplete-suggestions .autocomplete-group strong{display:block;border-bottom:1px solid #000}.city-header{position:relative;line-height:36px;border-bottom:1px solid #cbcccd}.city-current{font-size:14px;font-weight:700}.city-panel-close{position:absolute;right:0;cursor:pointer;font-size:1.2em}.city-default{margin-left:20px;cursor:pointer;display:none}.city-hotlist{overflow:hidden;margin-top:5px;margin-bottom:6px}.city-hotlist li{float:left;margin-right:10px;color:#42a5f5;cursor:pointer}.city-hotlist li:hover{text-decoration:underline;color:#1e88e5}.city-sug{margin-top:-1px;margin-left:-6px}.city-pc-title{width:48%;display:inline-block;border:1px solid #cbcccd;border-bottom:none;border-radius:2px}.city-pc-title .city-select{background-color:#fff;border-bottom:none}.city-pc-title span{width:50%;display:inline-block;text-align:center;border-bottom:1px solid #cbcccd;cursor:pointer;background-color:#f7f7f7}.city-city-title{border-left:1px solid #cbcccd}.city-search{width:48%;margin-left:4%;display:inline-block;position:relative}.city-search input{border:1px solid #cbcccd;padding:5px 0 5px 34px;width:100%;border-radius:2px}.city-search-logo{left:6px;position:absolute}.city-city-letter,.city-province-letter{margin-top:10px;white-space:normal}.city-city-letter li,.city-province-letter li{display:inline-block;background-color:#F5F5F5;margin-left:6px;cursor:pointer;line-height:18px;width:18px;text-align:center}.city-city-letter li:hover,.city-letter-select,.city-province-letter li:hover{background-color:#0f89f5!important;color:#fff}.city-city-list,.city-province-list{display:none}.city-list>div{display:block}.city-list dl{margin:4px 0;position:relative}.dtrigger,.search{position:absolute}.city-list dl dt{float:left;font-weight:700;line-height:20px}.city-list dl dd{white-space:normal;line-height:20px;margin-bottom:8px}.city-list .city-city dd{margin:0 0 0 25px}.city-list dl dd li{display:inline-block;margin-right:9px;cursor:pointer;color:#999}.city-list dl dd li:hover{color:#0f89f5}.dtrigger{z-index:99999;cursor:move}.search{z-index:6201;left:15px;top:15px}.search .dragtop{top:-3px;left:0;height:10px;width:100%}.search .dragbottom{bottom:0;left:0;height:10px;width:100%}.search .dragleft{top:0;left:0;width:10px;height:100%}.search .dragright{right:0;top:0;width:10px;height:100%}.amap0{background-color:#4d90fe;background-image:-webkit-linear-gradient(top,#4d90fe,#4787ed)}.amap1{background-color:#0f89f5;background-image:-webkit-linear-gradient(top,#0f89f5,#1283e5);background-image:-moz-linear-gradient(top,#0f89f5,#1283e5);background-image:-o-linear-gradient(top,#0f89f5,#1283e5);background-image:linear-gradient(top,#0f89f5,#4787ed)}.amap2{background-color:#1386eb;background-image:-webkit-linear-gradient(top,#1386eb,#0f89f5)}.amap3{background-color:#157cd6;background-image:-webkit-linear-gradient(top,#157cd6,#0f89f5)}.amap4{background-color:#188ef5;background-image:-webkit-linear-gradient(top,#188ef5,#0f89f5)}.amap5{background-color:#198bfc;background-image:-webkit-linear-gradient(top,#198bfc,#1885f2)}.amap6{background-color:#327ffa;background-image:-webkit-linear-gradient(top,#327ffa,#186bf0)}.amap7{background-color:#4590e5;background-image:-webkit-linear-gradient(top,#4590e5,#4992f2)}.amap8{background-color:#1283e6}.searchboxshadow.round{border-radius:3px!important}.searchbox{position:relative;z-index:2201;width:360px;height:45px;background:#fff;box-shadow:0 2px 2px rgba(0,0,0,.15);border-radius:3px}.searchbox .logo{display:block;position:absolute;top:6px;left:8px;width:34px;height:34px;z-index:99999;cursor:pointer}.searchbox .iptbox{position:absolute;left:50px;top:0;width:265px;height:45px;box-sizing:border-box;z-index:2202;border-radius:2px}.searchbox #nearby,.searchbox #nearbybox{position:absolute;top:0;width:310px;height:45px;box-sizing:border-box}.searchbox #nearbybox{left:50px;z-index:2210;background:#fff;display:none}.searchbox #nearby{left:0;transition:width .2s ease;font-size:14px}.searchbox #nearbyipt{position:relative;top:12.5px;box-sizing:border-box;text-indent:2px;border:none;height:20px;line-height:20px;padding:0;width:120px}.searchbox #nearbyclosewrap{width:45px;height:45px;position:absolute;right:0;top:0;background-color:#f8f8f8;border-radius:0 2px 2px 0}.searchbox #nearbyclose{position:absolute;top:8.5px;right:10px;font-size:15px;padding:3px 5px;cursor:pointer}.searchbox #nearbybtn{position:absolute;right:45px;top:0;z-index:9308;box-sizing:border-box;width:45px;height:45px}.searchbox #nearbybtn .nearbylogo{position:absolute;top:8.5px;right:8px;font-size:19px;color:#919095;padding:0 5px}.searchbox #nearbybtn .nearbylogo:hover{color:#70b9f9;cursor:pointer}.searchbox #nearbyloading{position:absolute;top:8px;right:10px;z-index:2215;display:none}.searchbox #nearby span{position:relative;top:12.5px;color:#aaa}.searchbox #nearby .poiname{color:#333}#searchloading{position:absolute;top:15px;right:16px;z-index:2212;display:none}.searchbox #searchipt{position:absolute;top:12.5px;left:0;box-sizing:border-box;text-indent:2px;z-index:2200;border:none;width:219px;height:20px;line-height:20px;padding:0;letter-spacing:.5px;font-size:14px}.searchbox #searchipt::-webkit-input-placeholder{font-size:14px;color:#b7b8b9;font-weight:200;letter-spacing:1px;opacity:.8!important}.searchbox .direntry:hover,.themex .searchbox .searchlogo:hover{opacity:.8}.searchbox .iptbox #searchipt:-moz-placeholder{font-size:13px;color:#b7b8b9;font-weight:200;letter-spacing:1px}.searchbox .iptbox #searchipt::-moz-placeholder{font-size:13px;color:#b7b8b9;font-weight:200;letter-spacing:1px}.searchbox .iptbox #searchipt:-ms-input-placeholder{font-size:13px;color:#b7b8b9;font-weight:200;letter-spacing:1px}.searchbox .iptbox input::selection{background:rgba(94,165,247,.3)}.searchbox .iptbox input::-moz-selection{background:rgba(94,165,247,.3)}.searchbox .iptbox #searchbtn{position:absolute;right:0;top:0;z-index:9308;box-sizing:border-box;width:45px;height:45px}.searchbox .searchlogo{position:absolute;top:8.5px;right:8px;font-size:19px;color:#7c8196;padding:0 5px}.searchbox .searchlogo:hover{color:#42a5f5;cursor:pointer}.searchbox .direntry{width:45px;height:45px;position:absolute;right:0;top:0;text-align:center;background-color:#f8f8f8;border-radius:0 3px 3px 0}.searchbox .direntry .close-btn{position:absolute;top:8.5px;right:10px;font-size:15px;display:none;padding:3px 5px;cursor:pointer}.searchbox .direntry.in-main{background:#fff}.searchbox .direntry.in-dir .close-btn,.searchbox .direntry.in-main .close-btn{display:inline-block;color:#78909c}.searchbox .direntry.in-main .close-btn:hover{color:#90a4ae}.themex .searchbox,.themex .searchbox .searchlogo{color:#fff}.searchbox .direntry .fa-dir{position:absolute;top:9px;right:9px;width:16.5px;height:18px;padding:5px;cursor:pointer}.searchbox .direntry.in-dir .fa-dir,.searchbox .direntry.in-main .fa-dir{display:none}.searchbox #separator{position:absolute;right:38px;top:11px;height:24px;width:1px;background:#ccc}.main-sug.autocomplete-suggestions{margin-top:-5px;background:#fff;top:50px;left:0;border:none;border-top:1px solid #E4E6E7;box-shadow:1px 2px 1px rgba(0,0,0,.15);border-radius:0 0 2px 2px;max-width:360px}.main-sug .autocomplete-suggestion p{margin-right:12px}.main-sug .autocomplete-suggestion p strong{font-weight:400}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.ring{height:13px;width:13px;border:0 solid #ccc;border-radius:100%;border-bottom-color:transparent;border-width:1px;background:0 0;-webkit-animation:fa-spin 1s infinite linear;animation:fa-spin 1s infinite linear;-webkit-font-smoothing:subpixel-antialiased}.themex .searchbox,.themex .searchbox #searchipt{background:#0f89f5}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.themeA .searchbox .iptbox{border:none;border-radius:0;border-bottom:1px solid #dbdbdb}.themeA .searchbox .iptbox.active{border-bottom:1px solid #9cccf6}.themex .searchbox .iptbox{border:none;border-radius:0;border-bottom:1px solid #fff}.themex .searchbox #searchipt::-webkit-input-placeholder{color:#fff}.themex .searchbox .iptbox #searchipt:-moz-placeholder{color:#fff}.themex .searchbox .iptbox #searchipt::-moz-placeholder{color:#fff}.themex .searchbox .iptbox #searchipt:-ms-input-placeholder{color:#fff}.themex #searchloading{border:0 solid #fff;border-bottom-color:transparent;border-width:2px}.activity_wrap{width:360px;margin:10px 0}.activity_wrap img{width:330px;display:block;margin:0 auto 10px;cursor:pointer}.activity_wrap #amap-result-banner{width:330px;margin:0 auto}
171
+ </style>
172
+
173
+ <link rel="search" type="application/opensearchdescription+xml" href="/assets/opensearchnew.xml?v=1.1" title="高德地图" />
174
+
175
+ </head>
176
+ <body scroll="no">
177
+
178
+ <script type="text/javascript" id="beacon-aplus" src="//g.alicdn.com/alilog/mlog/aplus_v2.js" exparams="clog=o&aplus&sidx=aplusSidx&ckx=aplusCkx"></script>
179
+
180
+ <section id="search" class="search">
181
+ <header class="searchbox">
182
+ <img class="usel logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAAAXNSR0IArs4c6QAAF8pJREFUeAHtW2mUHNV1vlVdvU3PopHUGmnQMggQoA2xGWwWDY53O3ESTBacnDj+YTtO+JOc2Md/jHSynJDjYBI7OPExB+MFY5NzEjvEy4mAETGLkMTOsEQWAxIgGEmzdvdMd1e9fN99VdXVPa2ZkSAx8fEbVb3tvvvu/d69972qLon8Mv0SgfkQcObrPFGfMcYZl8PbfTGbgsBfLRKsdMXxTkTP9qx0T3W6y6ZOQJOq+n7fCfoW2xw4xhwNjDnsue7BVCr1E8dxZhY7OKI7KUBG6nuuLZmJz02bY+dWTTkVMVlMvia1TdalLmhL6geBjJVKbftOtdF1HANQXsL1ja5s9vOL5bMoQF4wD2+f9o/eNhEcWUvrWCzzJN3/NSDJuWExkxnP+2whl/unZHu7stuuMdl2wL//C6/Wnrl33H913amCkeT38yjXg6C7XK1+ZbJSuW8hHeb1+2fr995zxH9ucCEmPw8lT2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+k50G1GRvCD2NuWBL1d1jr2L+uHu9DqofMm3KD7jusHtc62/wHi3gbpiXrJnQAAAABJRU5ErkJggg==" draggable="false">
183
+ <div id="nearbybox">
184
+ <div id="nearby">
185
+ <span>在</span><span class="poiname">天安门...</span><span>周边搜</span>
186
+ <input type="text" id="nearbyipt" autocomplete="off" />
187
+ </div>
188
+ <div id="nearbyclosewrap">
189
+ <i id="nearbyclose" class="iconfont icon-close"></i>
190
+ </div>
191
+ <div id="nearbybtn">
192
+ <i class="iconfont icon-search nearbylogo"></i>
193
+ <span id="nearbyloading" class="ring"></span>
194
+ </div>
195
+ </div>
196
+
197
+ <div class="iptbox">
198
+ <input type="text" id="searchipt" placeholder="搜索位置、公交站、地铁站" maxlength="256" autocomplete="off" />
199
+
200
+ <div id="searchbtn" class="usel">
201
+ <i class="iconfont icon-search searchlogo icontip" title="搜索"></i>
202
+
203
+ <span id="searchloading" class="ring"></span>
204
+ </div>
205
+ </div>
206
+
207
+ <div class="direntry usel">
208
+ <img class="fa-dir icontip" title="路线" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAkCAYAAABxE+FXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJ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mas04MI5dsrMi5HsPaWqiX+rzxiYH1e81XU/Sro/TnjnVCXPEadrgHk2jxvBx+q5VG669UIzG1WJc8BA/RvLZM5LwMjdA/wE2lZeT0Y9nmFegGnYF9WHhco1ztwCa7BDXhWte1O4k9wDpLg1mSdX4F1cG/ykOGHxy44cmlEWuRfYJm22vjZvuVXrEp+AVJ/0dXe6eKptaU+2ozxLxPH4Em3/PDXZ5BX2uoTmW37FmAA/hxExSsxtXsAAAAASUVORK5CYII=" draggable="false">
209
+ <i class="close-btn iconfont icon-close"></i>
210
+ </div>
211
+ </header>
212
+ <div class="amap-search-panctrl">
213
+
214
+ </div>
215
+ <div class="dtrigger dragtop"></div>
216
+ <div class="dtrigger dragbottom"></div>
217
+ <div class="dtrigger dragleft"></div>
218
+ <div class="dtrigger dragright"></div>
219
+ </section>
220
+
221
+
222
+
223
+ <section id="amapBox" class="amap-box fs-box"></section>
224
+
225
+
226
+ <div class="serp-box-con fs-box">
227
+ <section id="serpBox" class="serp-box translate-box" data-slide-d="0"></section>
228
+ </div>
229
+
230
+ <section id="dirBox">
231
+ <div id="dirbox" class="dirbox"></div>
232
+ <div class="dtrigger dragtop"></div>
233
+
234
+ <div class="dtrigger dragleft"></div>
235
+ <div class="dtrigger dragright"></div>
236
+ </section>
237
+
238
+
239
+
240
+ <div id="loginbox" class="usel loginbox" ></div>
241
+
242
+
243
+ <div id="themap"></div>
244
+
245
+
246
+ <div id="maptoolbox" class="maptoolbox"></div>
247
+
248
+
249
+ <div id="layerbox" class="layerbox usel"></div>
250
+ <div id="exitFullscreen">退出全屏</div>
251
+ <div class="lushu_ctrl"></div>
252
+
253
+
254
+ <div class="dir_qr"></div>
255
+
256
+
257
+ <div class="iw_tmp" style="position:absolute;"></div>
258
+
259
+
260
+ <div id="livephotoshow"></div>
261
+
262
+
263
+ <div id="activity_box"></div>
264
+
265
+ <div id="planBox">
266
+ <div class="plan-list-c"></div>
267
+ <div class="plan-create-c"></div>
268
+ <div class="plan-detail-c"></div>
269
+ </div>
270
+
271
+ <div id="planSrhBox"></div>
272
+ <script>
273
+ // window.forbidenWebGL = true;
274
+ (function(){
275
+ var now = (new Date()).getTime();
276
+ var start = 1585929600000;
277
+ var end = 1586016000000;
278
+ if(now >= start && now < end){
279
+ var bodyElement = document.body;
280
+ bodyElement.setAttribute('class', 'grey-filter-theme');
281
+ }
282
+ })();
283
+ </script>
284
+ <script type='text/javascript'>
285
+ !function(a){window.amap={tileLayer:{}};var b,c={code:"0"},d=function(){var a=window.performance&&window.performance.now()||Date.now()-Tracker.fht;return parseInt(a)},e=function(a){try{var b=localStorage.getItem("newloc")||"{}",c=JSON.parse(b);c.cip&&localStorage.setItem("newloc_"+c.cip,c),c.time,localStorage.removeItem("newloc")}catch(a){console.log(a)}var d="newloc_"+(a||""),e=localStorage.getItem(d);return e=e?JSON.parse(e):{},e.time&&(e.code="1"),e},f=function(){var a="/service/locator?rand="+Math.random(),f=new XMLHttpRequest;f.overrideMimeType&&f.overrideMimeType("text/xml"),f.open("GET",a,!0),f.timeout=3e3,f.onreadystatechange=function(){if(4==f.readyState){if(window.Tracker.rt.rt_locend=d(),__WPO.speed(5),200==f.status){var a={};f.responseText&&(a=JSON.parse(f.responseText)),amap.cip=a.cip;var b=e(a.cip),h=b.time&&Date.now()-b.time<(b.duration||0),i=b.cip===amap.cip;b.lat&&i&&h?(a=b,console.log("[oriloc]")):a=g(a)}else a=c;amap.oriloc=a,window.loopCheckShowMap&&loopCheckShowMap()}},f.ontimeout=function(){var a=c;b&&b(a)},f.send(null)},g=function(a){return 1==a.code&&a.lng&&a.lat?(a.needDecode=1,a):"6"!=a.status?c:void(location.href="/verify/?from="+encodeURIComponent(location.href)+"&channel=PL")};!function(){window.Tracker.rt.rt_locstart=d(),__WPO.speed(3),f()}()}();
286
+ </script>
287
+ <script type="text/javascript">
288
+ window._AMapSecurityConfig = {
289
+ serviceHost:'/_AMapService',
290
+ // 例如 :serviceHost:'http://1.1.1.1:80/_AMapService',
291
+ }
292
+ </script>
293
+ <script src="//webapi.amap.com/maps?v=2.0&key=d1f15ad3fdf0c704434eaf23c7c18698&plugin=AMap.Adaptor"></script>
294
+ <script type='text/javascript' src='/build/map.a9d3913ec27e73540126.js'></script>
295
+ </body>
296
+ </html>
html/.DS_Store ADDED
Binary file (6.15 kB). View file
 
html/alter.html ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title id="t">Document</title>
8
+ </head>
9
+ <body>
10
+ <script>
11
+ alert('这个是测试 弹窗内容')
12
+ </script>
13
+ <div id="main" href="北理工">
14
+ <p id="top"><p>程序员</p></p>
15
+ </div>
16
+ </body>
17
+ </html>
html/drop_down.html ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <body>
3
+ <select id="ShippingMethod" onchange="updateShipping(options[selectedIndex]);" name="ShippingMethod">
4
+ <option value="12.51">UPS Next Day Air ==> $12.51</option>
5
+ <option value="11.61">UPS Next Day Air Saver ==> $11.61</option>
6
+ <option value="10.69">UPS 3 Day Select ==> $10.69</option>
7
+ <option value="9.03">UPS 2nd Day Air ==> $9.03</option>
8
+ <option value="8.34">UPS Ground ==> $8.34</option>
9
+ <option value="9.25">USPS Priority Mail Insured ==> $9.25</option>
10
+ <option value="7.45">USPS Priority Mail ==> $7.45</option>
11
+ <option value="3.20" selected="">USPS First Class ==> $3.20</option>
12
+ </select>
13
+ </body>
14
+ </html>
html/frame.html ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
4
+ <title>frame</title>
5
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
6
+ <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css"
7
+ rel="stylesheet" />
8
+ <script type="text/javascript">$(document).ready(function () {
9
+ });</script>
10
+ </head>
11
+
12
+ <body>
13
+ <div class="row-fluid">
14
+ <div class="span10 well">
15
+ <h3>frame</h3>
16
+ <iframe id="f1" src="inner.html" width="800" , height="600"></iframe>
17
+ </div>
18
+ </div>
19
+ </body>
20
+ <script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.8/dist/js/bootstrap.min.js"></script></html>
21
+ </html>
html/hello.html ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ <div>
2
+ <ul>
3
+ <li class="item-0"><a href="link1.html">first item</a></li>
4
+ <li class="item-1"><a href="link2.html">second item</a></li>
5
+ <li class="item-inactive"><a href="link3.html"><span class="bold">third item</span></a></li>
6
+ <li class="item-1"><a href="link4.html">fourth item</a></li>
7
+ <li class="item-0"><a href="link5.html">fifth item</a></li>
8
+ </ul>
9
+ </div>
html/inner.html ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
4
+ <title>inner</title>
5
+ </head>
6
+ <body>
7
+ <div class="row-fluid">
8
+ <div class="span6 well">
9
+ <h3>inner</h3>
10
+ <iframe id="f2" src="https://www.baidu.com//" width="700" height="500"></iframe>
11
+ <a href="javascript:alert('watir-webdriver better than selenium webdriver;')">click</a>
12
+ </div>
13
+ </div>
14
+ </body>
15
+ </html>
html/level_locate.html ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
4
+ <title>Level Locate</title>
5
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
6
+ <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.9/dist/css/bootstrap.min.css"
7
+ rel="stylesheet"/>
8
+ </head>
9
+ <body>
10
+ <h3>Level locate</h3>
11
+ <div class="span3 col-md-3">
12
+ <div class="well">
13
+ <div class="dropdown">
14
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">Link1</a>
15
+ <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel" id="dropdown1">
16
+ <li><a tabindex="-1" href="http://www.bjsxt.com">Action</a></li>
17
+ <li><a tabindex="-1" href="#">Another action</a></li>
18
+ <li><a tabindex="-1" href="#">Something else here</a></li>
19
+ <li class="divider"></li>
20
+ <li><a tabindex="-1" href="#">Separated link</a></li>
21
+ </ul>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <div class="span3 col-md-3">
26
+ <div class="well">
27
+ <div class="dropdown">
28
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">Link2</a>
29
+ <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
30
+ <li><a tabindex="-1" href="#">Action</a></li>
31
+ <li><a tabindex="-1" href="#">Another action</a></li>
32
+ <li><a tabindex="-1" href="#">Something else here</a></li>
33
+ <li class="divider"></li>
34
+ <li><a tabindex="-1" href="#">Separated link</a></li>
35
+ </ul>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </body>
40
+ <script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.9/dist/js/bootstrap.min.js"></script>
41
+ </html>
html/scroll.html ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>jQuery UI Draggable - Auto-scroll</title>
7
+ <link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
8
+ <style>
9
+ #draggable, #draggable2, #draggable3 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
10
+ body {font-family: Arial, Helvetica, sans-serif;}
11
+ table {font-size: 1em;}
12
+ .ui-draggable, .ui-droppable {background-position: top;}
13
+ </style>
14
+ <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
15
+ <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
16
+ <script>
17
+ $( function() {
18
+ $( "#draggable" ).draggable({ scroll: true });
19
+ $( "#draggable2" ).draggable({ scroll: true, scrollSensitivity: 100 });
20
+ $( "#draggable3" ).draggable({ scroll: true, scrollSpeed: 100 });
21
+ } );
22
+ </script>
23
+ </head>
24
+ <body>
25
+ <div id="draggable" class="ui-widget-content">
26
+ <p>Scroll set to true, default settings</p>
27
+ </div>
28
+
29
+ <div id="draggable2" class="ui-widget-content">
30
+ <p>scrollSensitivity set to 100</p>
31
+ </div>
32
+
33
+ <div id="draggable3" class="ui-widget-content">
34
+ <p>scrollSpeed set to 100</p>
35
+ </div>
36
+ <div style="height: 5000px; width: 1px;"></div>
37
+ </body>
38
+ </html>
html/test01.html ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
4
+ <title>Level Locate</title>
5
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
6
+ <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.9/dist/css/bootstrap.min.css" rel="stylesheet" />
7
+ </head>
8
+ <body>
9
+ <h3>Level locate</h3>
10
+ <div class="span3 col-md-3">
11
+ <div class="well">
12
+ <div class="dropdown">
13
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">Link1</a>
14
+ <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel" id="dropdown1" >
15
+ <li><a tabindex="-1" href="http://www.bjsxt.com">Action</a></li>
16
+ <li><a tabindex="-1" href="#">Another action</a></li>
17
+ <li><a tabindex="-1" href="#">Something else here</a></li>
18
+ <li class="divider"></li>
19
+ <li><a tabindex="-1" href="#">Separated link</a></li>
20
+ </ul>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ <div class="span3 col-md-3">
25
+ <div class="well">
26
+ <div class="dropdown">
27
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">Link2</a>
28
+ <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel" >
29
+ <li><a tabindex="-1" href="#">Action</a></li>
30
+ <li><a tabindex="-1" href="#">Another action</a></li>
31
+ <li><a tabindex="-1" href="#">Something else here</a></li>
32
+ <li class="divider"></li>
33
+ <li><a tabindex="-1" href="#">Separated link</a></li>
34
+ </ul>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </body>
39
+ <script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.9/dist/js/bootstrap.min.js"></script></html>
html/猫眼电影.html ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <!DOCTYPE html>
3
+
4
+ <!--[if IE 8]><html class="ie8"><![endif]-->
5
+ <!--[if IE 9]><html class="ie9"><![endif]-->
6
+ <!--[if gt IE 9]><!--><html><!--<![endif]-->
7
+ <head>
8
+ <title>猫眼电影PC端</title>
9
+
10
+ <link rel="dns-prefetch" href="//p0.meituan.net" />
11
+ <link rel="dns-prefetch" href="//p1.meituan.net" />
12
+ <link rel="dns-prefetch" href="//ms0.meituan.net" />
13
+ <link rel="dns-prefetch" href="//ms1.meituan.net" />
14
+ <link rel="dns-prefetch" href="//lx.meituan.net"/>
15
+ <link rel="dns-prefetch" href="//lx1.meituan.net"/>
16
+ <link rel="dns-prefetch" href="//plx.meituan.com"/>
17
+
18
+
19
+ <meta charset="utf-8">
20
+ <meta name="keywords" content="">
21
+ <meta name="description" content="">
22
+ <meta http-equiv="cleartype" content="yes" />
23
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
24
+ <meta name="renderer" content="webkit" />
25
+
26
+ <meta name="HandheldFriendly" content="true" />
27
+ <meta name="format-detection" content="email=no" />
28
+ <meta name="format-detection" content="telephone=no" />
29
+ <meta name="viewport" content="width=device-width, initial-scale=1">
30
+
31
+
32
+ <script>"use strict";!function(){var i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"_Owl_",n=window;n[i]||(n[i]={isRunning:!1,isReady:!1,preTasks:[],dataSet:[],use:function(i,t){this.isReady&&n.Owl&&n.Owl[i](t),this.preTasks.push({api:i,data:[t]})},add:function(i){this.dataSet.push(i)},run:function(){var t=this;if(!this.isRunning){this.isRunning=!0;var i=n.onerror;n.onerror=function(){this.isReady||this.add({type:"jsError",data:arguments}),i&&i.apply(n,arguments)}.bind(this),(n.addEventListener||n.attachEvent)("error",function(i){t.isReady||t.add({type:"resError",data:[i]})},!0)}}},n[i].run())}();</script>
33
+ <script>
34
+ cid = "c_47wrcgg";
35
+ ci = 1;
36
+ val = {"id":"1299372"}; window.system = {};
37
+
38
+ window.openPlatform = '';
39
+ window.openPlatformSub = '';
40
+ window.$mtsiFlag = '0';
41
+ window.NODE_ENV = 'production';
42
+
43
+ </script>
44
+ <link rel="stylesheet" href="//s3.meituan.net/static-prod01/com.sankuai.movie.fe.mywww-files/common.118924d9.css"/>
45
+ <link rel="stylesheet" href="//s3.meituan.net/static-prod01/com.sankuai.movie.fe.mywww-files/movie-detail-index.b6e418a1.css"/>
46
+ <script crossorigin="anonymous" src="//s3.meituan.net/static-prod01/com.sankuai.movie.fe.mywww-files/stat.b4e55d45.js"></script>
47
+ <script>if(window.devicePixelRatio >= 2) { document.write('<link rel="stylesheet" href="//s3.meituan.net/static-prod01/com.sankuai.movie.fe.mywww-files/image-2x.8ba7074d.css"/>') }</script>
48
+ <script>
49
+ window.mta && mta('tag', 'page', '/films/-id-')
50
+ </script>
51
+ <style>
52
+ @font-face{font-family: "mtsi-font";src:url("//s3plus.meituan.net/v1/mss_73a511b8f91f43d0bdae92584ea6330b/font/2a70c44b.eot");src:url("//s3plus.meituan.net/v1/mss_73a511b8f91f43d0bdae92584ea6330b/font/2a70c44b.eot?#iefix") format("embedded-opentype"),url("//s3plus.meituan.net/v1/mss_73a511b8f91f43d0bdae92584ea6330b/font/2a70c44b.woff");}
53
+ .stonefont {
54
+ font-family: mtsi-font;
55
+ }
56
+ </style>
57
+ <script>
58
+ var _hmt = _hmt || [];
59
+ (function() {
60
+ var hm = document.createElement("script");
61
+ hm.src = "https://hm.baidu.com/hm.js?703e94591e87be68cc8da0da7cbd0be2";
62
+ var s = document.getElementsByTagName("script")[0];
63
+ s.parentNode.insertBefore(hm, s);
64
+ })();
65
+ </script>
66
+ </head>
67
+ <body>
68
+
69
+
70
+ <div class="header">
71
+ <div class="header-inner">
72
+ <a href="//www.maoyan.com" class="logo" data-act="icon-click">猫眼电影</a>
73
+ <div class="city-container" data-val="{currentcityid:1 }">
74
+ <div class="city-selected">
75
+ <div class="city-name">
76
+ 北京
77
+ <span class="caret"></span>
78
+ </div>
79
+ </div>
80
+ <div class="city-list" data-val="{ localcityid: 1 }">
81
+ <div class="city-list-header">定位城市:<a class="js-geo-city" data-ci="1">北京</a></div>
82
+ </div>
83
+ </div>
84
+
85
+
86
+ <div class="nav">
87
+ <div><a href="/" data-act="home-click" >首页</a></div>
88
+ <div><a href="/films" data-act="movies-click" >电影</a></div>
89
+ <div><a href="/cinemas" data-act="cinemas-click" >影院</a></div>
90
+ <div><a href="http://www.gewara.com">演出</a></div>
91
+ <!-- <div><a href="/dramas" data-act="TVdramas-click" >电视剧</a></div> -->
92
+ <!-- <div><a href="/board" data-act="board-click" >榜单</a></div> -->
93
+ <!-- <div><a href="/news" data-act="hotNews-click" >热点</a></div>
94
+ -->
95
+ <!-- <div><a href="/edimall" >商城</a></div> -->
96
+ </div>
97
+
98
+ <div class="user-info">
99
+ <div class="user-avatar J-login">
100
+ <img src="https://p0.meituan.net/movie/7dd82a16316ab32c8359debdb04396ef2897.png">
101
+ <span class="caret"></span>
102
+ <ul class="user-menu no-login-menu">
103
+ <li><a href="javascript:void 0">登录</a></li>
104
+ </ul>
105
+ </div>
106
+ </div>
107
+
108
+ <form style="display: none;" action="/query" target="_blank" class="search-form" data-actform="search-click">
109
+ <input name="kw" class="search" type="search" maxlength="32" placeholder="找影视剧、影人、影院" autocomplete="off">
110
+ <input class="submit" type="submit" value="">
111
+ </form>
112
+
113
+ <div class="app-download">
114
+ <a href="/app" target="_blank">
115
+ <span class="iphone-icon"></span>
116
+ <span class="apptext">APP下载</span>
117
+ <span class="caret"></span>
118
+ <div class="download-icon">
119
+ <p class="down-title">扫码下载APP</p>
120
+ <p class='down-content'>选座更优惠</p>
121
+ </div>
122
+ </a>
123
+ </div>
124
+
125
+ </div>
126
+ </div>
127
+ <div class="header-placeholder"></div>
128
+
129
+ <div class="block-banner"></div>
130
+
131
+ <div class="container" id="app" class="page-movie/detail-index" >
132
+ <div class="loading-wrapper">
133
+ <span class="loading-img"></span>
134
+ 加载中...
135
+ </div>
136
+ </div>
137
+
138
+ <div class="footer">
139
+ <p class="friendly-links">
140
+ 关于猫眼 :
141
+ <a href="https://ir.maoyan.com/Company-Information">关于我们</a>
142
+ <span></span>
143
+ <a href="https://ir.maoyan.com/Board-Members">董事会成员</a>
144
+ <span></span>
145
+ <a href="https://ir.maoyan.com">投资者关系</a>
146
+ &nbsp;&nbsp;&nbsp;&nbsp;
147
+ 友情链接 :
148
+ <a href="http://www.meituan.com" data-query="utm_source=wwwmaoyan">美团网</a>
149
+ <span></span>
150
+ <a href="http://www.gewara.com" data-query="utm_source=wwwmaoyan">格瓦拉</a>
151
+ <span></span>
152
+ <a href="http://i.meituan.com/client" data-query="utm_source=wwwmaoyan">美团下载</a>
153
+ <span></span>
154
+ <a href="https://www.huanxi.com" data-query="utm_source=maoyan_pc">欢喜首映</a>
155
+ </p>
156
+ <p class="friendly-links">
157
+ 商务合作邮箱:v@maoyan.com
158
+ 客服电话:10105335
159
+ 违法和不良信息/涉未成年人有害信息举报电话:4006018900
160
+ </p>
161
+ <p class="friendly-links">
162
+ 用户举报/涉未成年人有害信息举报邮箱:tousujubao@meituan.com
163
+ 舞弊线索举报邮箱:wubijubao@maoyan.com
164
+ </p>
165
+ <p class="friendly-links credentials">
166
+ <a href="/about/licence/1" target="_blank">中华人民共和国增值电信业务经营许可证 京B2-20190350</a>
167
+ <span></span>
168
+ <a href="/about/licence/4" target="_blank">营业性演出许可证 京演(机构)(2019)4094号</a>
169
+ </p>
170
+ <p class="friendly-links credentials">
171
+ <a href="/about/licence/3" target="_blank">广播电视节目制作经营许可证 (京)字第08478号</a>
172
+ <span></span>
173
+ <a href="/about/licence/2" target="_blank">网络文化经营许可证 京网文(2022)1334-041号 </a>
174
+ </p>
175
+ <p class="friendly-links credentials">
176
+ <a href="/about/licence/6" target="_blank">艺术品经营单位备案证明 京东艺(2022)0095号 </a>
177
+ </p>
178
+ <p class="friendly-links credentials">
179
+ <a href="/rules/agreement" target="_blank">猫眼用户服务协议 </a>
180
+ <span></span>
181
+ <a href="/rules/rule" target="_blank">猫眼平台交易规则总则 </a>
182
+ <span></span>
183
+ <a href="/rules/privacy" target="_blank">隐私政策 </a>
184
+ </p>
185
+ <p class="friendly-links credentials">
186
+ <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010102003232">京公网安备
187
+ 11010102003232号</a>
188
+ <span></span>
189
+ <a href="http://beian.miit.gov.cn/">京ICP备16022489号-1</a>
190
+ </p>
191
+ <p>北京猫眼文化传媒有限公司</p>
192
+ <p>
193
+ &copy;<span class="my-footer-year">2016</span>
194
+ 猫眼电影 www.maoyan.com</p>
195
+ <div class="certificate">
196
+ <a href="http://sq.ccm.gov.cn:80/ccnt/sczr/service/business/emark/toDetail/350CF8BCA8416C4FE0530140A8C0957E">
197
+ <img src="https://p0.meituan.net/moviemachine/e54374ccf134d1f7b2c5b075a74fca525326.png" />
198
+ </a>
199
+ <a href="/about/licence/5" target="_blank">
200
+ <img src="https://p1.meituan.net/moviemachine/805f605d5cf1b1a02a4e3a5e29df003b8376.png" />
201
+ </a>
202
+ <a href="https://www.12377.cn">
203
+ <img src="https://p0.meituan.net/scarlett/3cd2a9b7dc179531d20d27a5fd686e783787.png" />
204
+ </a>
205
+ </div>
206
+ </div>
207
+
208
+ <script crossorigin="anonymous" src="//www.dpfile.com/app/owl/static/owl_1.7.11.js"></script>
209
+ <script>
210
+ Owl.start({
211
+ project: 'com.sankuai.myfe.mywww.media',
212
+ pageUrl: location.href.split('?')[0].replace(/\/\d+/g, '/:id'),
213
+ devMode: false
214
+ })
215
+ </script>
216
+ <!--[if IE 8]><script crossorigin="anonymous" src="//s3.meituan.net/static-prod01/com.sankuai.movie.fe.mywww-files/es5-shim.bbad933f.js"></script><![endif]-->
217
+ <!--[if IE 8]><script crossorigin="anonymous" src="//s3.meituan.net/static-prod01/com.sankuai.movie.fe.mywww-files/es5-sham.221f40f5.js"></script><![endif]-->
218
+ <script crossorigin="anonymous" src="//s3.meituan.net/static-prod01/com.sankuai.movie.fe.mywww-files/common.98116ed1.js"></script>
219
+ <script crossorigin="anonymous" src="//s3.meituan.net/static-prod01/com.sankuai.movie.fe.mywww-files/movie-detail-index.c28808cd.js"></script>
220
+ <script src="//lx.meituan.net/lx.js" type="text/javascript" charset="utf-8" async></script>
221
+ </body>
222
+ </html>
scrap.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """quote: 进行URL编码,发送中文请求"""
2
+
3
+ from urllib.request import urlopen,Request
4
+ from fake_useragent import UserAgent
5
+ from urllib.parse import quote
6
+
7
+ url = f'https://www.amap.com'
8
+
9
+ # 随机生成用户代理
10
+ ua = UserAgent()
11
+ headers = {
12
+ 'User-Agent':ua.chrome
13
+ }
14
+
15
+ # 创建 request对象
16
+ req = Request(url,headers = headers)
17
+
18
+ # 发送请求
19
+ resp = urlopen(req)
20
+
21
+ with open("./gaode.html", 'w') as f:
22
+ f.write(resp.read().decode())
scrapy/.DS_Store ADDED
Binary file (8.2 kB). View file
 
scrapy/__init__.py ADDED
File without changes
scrapy/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (166 Bytes). View file
 
scrapy/gaode/gaode.html ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+
4
+ <head>
5
+ <meta name="aplus-core" content="aplus.js">
6
+ <meta name="aplus-waiting" content="MAN">
7
+ <meta charset="UTF-8"/>
8
+ <meta name="data-spm" content="a2l02" />
9
+ <meta name="renderer" content="webkit|ie-comp|ie-stand">
10
+ <meta name="renderer" content="webkit">
11
+ <meta name="baidu-site-verification" content="zyu2elKF1h" />
12
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
13
+
14
+ <meta name="Keywords" content="地图,高德地图,高德地图官网,amap地图,搜索地点,公交查询,驾车导航,中国地图,北京地图,街景地图,团购,优惠信息">
15
+ <meta name="Description" content="高德地图官方网站,提供全国地图浏览,地点搜索,公交驾车查询服务。可同时查看商家团购、优惠信息。高德地图,您的出行、生活好帮手。">
16
+ <meta name="baidu-site-verification" content="code-CsHgD815DF" />
17
+ <meta name="robots" content="noodp">
18
+ <title>
19
+ 高德地图
20
+ </title>
21
+ <link rel="shortcut icon" href="//a.amap.com/pc/static/favicon.ico">
22
+ <style>
23
+ .grey-filter-theme {
24
+ -webkit-filter: grayscale(100%);
25
+ filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
26
+ filter: grayscale(100%);
27
+ filter: gray;
28
+ }
29
+ </style>
30
+ <script type="text/javascript" src="https://a.amap.com/pc/static/config/commonConfig.js"></script>
31
+ <script src="//g.alicdn.com/??AWSC/AWSC/awsc.js,sd/baxia-entry/baxiaCommon.js"></script>
32
+ <script type="text/javascript" src="https://g.alicdn.com/dt/tracker/4.3.1/??tracker.Tracker.js,tracker.interfaceTrackerPlugin.js" crossorigin></script>
33
+ <script type="text/javascript">
34
+
35
+ var tracker = new window.Tracker({
36
+ pid: 'lbs-amap-pc',
37
+ plugins: [
38
+ [window.interfaceTrackerPlugin]
39
+ ],
40
+ });
41
+
42
+ // 启动 tracker 并监听全局 JS 异常
43
+ tracker.install();
44
+ </script>
45
+ <script type="text/javascript">
46
+ window.config = {
47
+ "around": [{
48
+ "key": "meishi",
49
+ "name": "美食",
50
+ "pic": "https://a.amap.com/pc/static/img/meishi.png",
51
+ "picnew": "https://a.amap.com/pc/static/img/search_food.png", "href": ""
52
+ },
53
+ {
54
+ "key": "hotel",
55
+ "name": "酒店",
56
+ "pic": "https://a.amap.com/pc/static/img/hotel.png",
57
+ "picnew": "https://a.amap.com/pc/static/img/search_hotel.png",
58
+ "href": "" },
59
+ {
60
+ "key": "scenic",
61
+ "name": "景点",
62
+ "pic": "https://a.amap.com/pc/static/img/scene.png",
63
+ "picnew": "https://a.amap.com/pc/static/img/search_view.png",
64
+ "href": ""
65
+ },
66
+ {
67
+ "key": "cinema",
68
+ "name": "小区",
69
+ "pic": "https://a.amap.com/pc/static/img/residence.png",
70
+ "picnew": "https://a.amap.com/pc/static/img/search_house.png",
71
+ "href": ""
72
+ }],
73
+ "lushu_link": {
74
+ "link1": "http://lbsbbs.amap.com/forum.php?mod=forumdisplay&fid=60",
75
+ "link2": "http://lbsbbs.amap.com/forum.php?mod=viewthread&tid=22920&extra=page%3D1",
76
+ "link3": "javascript:void(0)"
77
+ },
78
+ "mapCode": "GS(2019)6379号",
79
+ "jiace": "甲测资字11002004",
80
+ "amapBeian": "<a href='https://beian.miit.gov.cn' target='_blank'>京ICP备07017245号-2</a>",
81
+ "gaodeBeian": "<a href='https://beian.miit.gov.cn' target='_blank'>京ICP备07017245号-7</a>",
82
+ "anbei": " - <span><a target='_blank' style='color:#565656' href='http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010502030880'><img style='margin-bottom:1px' src='/assets/img/beian.png' />京公网安备 11010502030880号</a></span>",
83
+ "jubao": " | 未成年人举报邮箱:gd.wcn.jubao@service.autonavi.com",
84
+ "satelliteCode": "GS(2021)1328号 - Image© DigitalGlobe&spaceview",
85
+ "placeholder": "搜索位置、公交站、地铁站",
86
+ "yunqiBanner": false,
87
+ "activebanner": [{
88
+ "imgurl": "https://a.amap.com/pc/static/img/spring_transport.png",
89
+ "show": false,
90
+ "target" : "_blank",
91
+ "jumpurl": "http://chunyun.itsc.cn",
92
+ "trace": "springtransport"
93
+ }]
94
+ };
95
+ </script>
96
+ <script type="text/javascript">
97
+ if (/mobile/i.test(navigator.userAgent) && !/ipad/i.test(navigator.userAgent) && location.pathname !== '/jumpm') {
98
+ //m站参数
99
+ var exchangepath = location.pathname + location.search + location.hash;
100
+
101
+ if(exchangepath.indexOf('platform=pc') < 0){
102
+ location.href = "https://m.amap.com?amapexchange=" + encodeURIComponent(exchangepath);
103
+ }
104
+
105
+ }
106
+
107
+ if (!document.all) { //IE11 or other
108
+ //HireInfo
109
+ } else { //IE6-10
110
+
111
+ if (window.navigator.appName !== 'Microsoft Internet Explorer') {
112
+ //非IE
113
+ } else {
114
+
115
+ var mode = 5;
116
+
117
+ if (document.documentMode) {
118
+ mode = document.documentMode;
119
+ } else if (document.compatMode) {
120
+ if (document.compatMode === 'CSS1Compat') {
121
+ mode = 7;
122
+ }
123
+ }
124
+
125
+ var rv = -1,
126
+ ua = navigator.userAgent;
127
+ var re = new RegExp('MSIE ([0-9]{1,}[\\.0-9]{0,})');
128
+ if (re.exec(ua) !== null) {
129
+ rv = parseFloat(RegExp.$1);
130
+ }
131
+
132
+ var v = 11;
133
+
134
+ //IE11
135
+ if (mode < v || rv < v) {
136
+ location.href = "http://map.amap.com";
137
+ }
138
+
139
+ }
140
+ }
141
+
142
+ window.Tracker = {fht: Date.now(), fpt: window.performance && performance.now() || Date.now(),aid: 2, percent: 100, rt: {}};
143
+ var _czc = _czc || [];
144
+ _czc.push(["_setAutoPageview", false]);
145
+ var _t = Date.now();
146
+ var startTime = new Date();
147
+
148
+ window.__WPO = {
149
+ config: {
150
+ // sample: 1,
151
+ // spmId: 'a2l02',
152
+ // dynamic: false
153
+ }
154
+ };
155
+ __WPO.speed = function () {};
156
+ __WPO.custom = function () {};
157
+
158
+ // aes_config
159
+ window.AES_CONFIG = window.AES_CONFIG || {};
160
+
161
+ AES_CONFIG.pid = 'amap-pc';
162
+ AES_CONFIG.user_type = '101';
163
+ AES_CONFIG.uid = '';
164
+ AES_CONFIG.username = '';
165
+
166
+ </script>
167
+
168
+
169
+ <style type='text/css'>
170
+ /*! normalize.css v3.0.2 | MIT License | git.io/normalize */body,html{width:100%;height:100%}html,svg:not(:root){overflow:hidden}img,legend{border:0}body,legend,ol,td,th,ul{padding:0}body,h1,h2,h3,h4,h5,ol,p,ul{margin:0}#citybox .air-quality:hover,#layerbox_item .item:hover{opacity:.6}html{font-family:Arial,sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{font-size:12px;line-height:1.5;color:#565656;word-wrap:break-word}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent;color:#0f89f5;text-decoration:none}a:active,a:hover{outline:0;text-decoration:underline}abbr[title]{border-bottom:1px dotted}b,optgroup,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{vertical-align:middle}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;outline:0}input::-ms-clear{display:none}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}.layerbox,.tooldragbar{position:absolute;cursor:move}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#amap-banner,#amap-banner-entry,#nav li,.city-pc-title span,.city-search input,.searchbox{box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}table{border-collapse:collapse;border-spacing:0}ol,ul{list-style:none}h1,h2,h3,h4,h5{font-weight:400}.amap-copyright{display:none;padding:0 4px;margin-bottom:4px;background:rgba(255,255,255,.6)}.amap-copyright.copyright_theme{background:rgba(0,0,0,.5);color:#fff}@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_110978_4497r7w1cgt.eot);src:url(//at.alicdn.com/t/font_110978_4497r7w1cgt.eot?#iefix) format('embedded-opentype'),url(//at.alicdn.com/t/font_110978_4497r7w1cgt.woff2) format('woff2'),url(//at.alicdn.com/t/font_110978_4497r7w1cgt.woff) format('woff'),url(//at.alicdn.com/t/font_110978_4497r7w1cgt.ttf) format('truetype'),url(//at.alicdn.com/t/font_110978_4497r7w1cgt.svg#iconfont) format('svg')}.iconfont{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-bfe:before{content:"\e658"}.icon-select:before{content:"\e657"}.icon-copylushu:before{content:"\e656"}.icon-icon-xinzenglushu:before{content:"\e655"}.icon-liebiao:before{content:"\e653"}.icon-shupingguangchang:before{content:"\e654"}.icon-iconfontzanxuanzhong:before{content:"\e6b3"}.icon-fabu:before{content:"\e650"}.icon-shaixuan:before{content:"\e652"}.icon-book:before{content:"\e64f"}.icon-cuxiao-s:before{content:"\e64e"}.icon-tuichu:before{content:"\e6a3"}.icon-duihao:before{content:"\e64d"}.icon-theme1:before{content:"\e66f"}.icon-theme:before{content:"\e65f"}.icon-wumai:before{content:"\e644"}.icon-tel:before{content:"\e64c"}.icon-rmb:before{content:"\e64a"}.icon-alipay:before{content:"\e648"}.icon-hui:before{content:"\e649"}.icon-tuan:before{content:"\e659"}.icon-caretup:before{content:"\e65b"}.icon-caretdown:before{content:"\e64b"}.icon-sortdown:before{content:"\e728"}.icon-sortup:before{content:"\e72a"}.icon-thlarge:before{content:"\e647"}.icon-circle:before{content:"\e675"}.icon-angleleft:before{content:"\e646"}.icon-star-o:before{content:"\e7bf"}.icon-chevronleft:before{content:"\e6e7"}.icon-chevronright:before{content:"\e6e8"}.icon-image:before{content:"\eb26"}.icon-map-marker:before{content:"\e6ea"}.icon-weixin2:before{content:"\e643"}.icon-weixin1:before{content:"\e645"}.icon-weixin:before{content:"\e68b"}.icon-icon-sina:before{content:"\e694"}.icon-qqkongjian:before{content:"\e65d"}.icon-add:before{content:"\e642"}.icon-kongjian:before{content:"\e682"}.icon-sina:before{content:"\e641"}.icon-qixing:before{content:"\e697"}.icon-icon:before{content:"\e651"}.icon-buxingyixuan:before{content:"\e669"}.icon-gongjiao:before{content:"\e640"}.icon-mai:before{content:"\e63f"}.icon-icon-v:before{content:"\e68f"}.icon-time:before{content:"\e74c"}.icon-wentidewen:before{content:"\e63b"}.icon-bookfood:before{content:"\e63c"}.icon-bookground:before{content:"\e63d"}.icon-bookrailway:before{content:"\e63e"}.icon-iconjia:before{content:"\e63a"}.icon-bookgoto:before{content:"\e639"}.icon-booklistpoi:before{content:"\e638"}.icon-bookairport:before{content:"\e637"}.icon-bookplane:before{content:"\e74d"}.icon-bookhotel:before{content:"\e633"}.icon-bookmall:before{content:"\e634"}.icon-bookheart:before{content:"\e635"}.icon-bookpark:before{content:"\e636"}.icon-bookedit:before{content:"\e631"}.icon-booksite:before{content:"\e632"}.icon-booksync:before{content:"\e630"}.icon-bookoverview:before{content:"\e62f"}.icon-bookauto:before{content:"\e62c"}.icon-bookback:before{content:"\e62d"}.icon-bookbubble:before{content:"\e62e"}.icon-mianxingtubiao1luxian:before{content:"\e62a"}.icon-qiche:before{content:"\e62b"}.icon-cloud-up:before{content:"\e629"}.icon-clear:before{content:"\e628"}.icon-iconbianji:before{content:"\e627"}.icon-iconshoucangjia:before{content:"\e626"}.icon-icontuichu:before{content:"\e625"}.icon-lushu:before{content:"\e61b"}.icon-satellite:before{content:"\e61c"}.icon-livephoto:before{content:"\e61d"}.icon-traffic:before{content:"\e61e"}.icon-fullscreen:before{content:"\e61f"}.icon-more:before{content:"\e620"}.icon-ranging:before{content:"\e621"}.icon-subway:before{content:"\e622"}.icon-check:before{content:"\e623"}.icon-exit:before{content:"\e624"}.icon-icontianjia:before{content:"\e61a"}.icon-iconrili:before{content:"\e619"}.icon-iconlajitong:before{content:"\e617"}.icon-iconzhiding:before{content:"\e618"}.icon-icontishibaocuo:before{content:"\e616"}.icon-icontishixinxi:before{content:"\e615"}.icon-iconduihao:before{content:"\e614"}.icon-iconfenxiang:before{content:"\e613"}.icon-history:before{content:"\e609"}.icon-downarrow:before{content:"\e60a"}.icon-arrowup:before{content:"\e60b"}.icon-magnifer:before{content:"\e60c"}.icon-delete:before{content:"\e60d"}.icon-switchroute:before{content:"\e60e"}.icon-whytip:before{content:"\e60f"}.icon-clearmap:before{content:"\e610"}.icon-mapcenter:before{content:"\e611"}.icon-where:before{content:"\e612"}.icon-close:before{content:"\e603"}.icon-buss:before{content:"\e604"}.icon-cars:before{content:"\e605"}.icon-poi:before{content:"\e606"}.icon-poi2:before{content:"\e607"}.icon-search:before{content:"\e608"}.icon-star:before{content:"\e600"}.icon-nearby:before{content:"\e601"}.icon-phone:before{content:"\e602"}.layerbox{top:15px;left:calc(100% - 385px);z-index:1999;background:#fff;border-radius:1px;box-shadow:0 2px 2px rgba(0,0,0,.15)}.tooldragdown,.tooldragup{height:10px;width:100%;left:0}.tooldragup{top:-5px}.tooldragdown{bottom:-5px}.tooldragleft,.tooldragright{height:100%;width:12px;top:0}.tooldragleft{left:-6px}.tooldragright{right:-6px}#layerbox{background:#fff;z-index:112;-webkit-border-radius:1px;-moz-border-radius:1px;-o-border-radius:1px;border-radius:3px}#layerbox_item{padding:14px 0 13px;background:#fff;border-radius:3px;height:18px}#layerbox_item .show-list{position:relative}#layerbox_item .show-list .red-point{display:none;width:4px;height:4px;background-color:red;border-radius:4px;position:absolute;top:0;left:122px;border:1px solid red;z-index:100}#layerbox_item .item{float:left;height:18px;padding:0 12px;font-size:12px;border-left:1px #dbdee2 dashed;vertical-align:middle;cursor:pointer;overflow:visible;zoom:1;color:#5f6477}#amap-panels,.ellipsis,.select_time,.select_week,body{overflow:hidden}#layerbox_item .item.no_border{border:0}#layerbox_item .item:first-child,#layerbox_item i+.item{border-left:0}#layerbox_item .item span{display:inline-block;vertical-align:middle;float:left}#layerbox_item .item .name{line-height:18px}#layerbox_item .item .icon{width:20px;height:18px;line-height:18px;margin-right:6px;color:#7c8196}#layerbox_item .item .icon .iconfont{width:20px;height:18px;line-height:18px;font-size:18px}#layerbox_item .item .icon .iconfont.icon-wumai{font-weight:700}#layerbox_item .item .icon .icon-livephoto,#layerbox_item .item .icon .icon-ranging{font-size:20px}#layerbox_item .item.active{color:#009cf9}#layerbox_item .item.active .iconfont{color:#2c9eff}#layerbox_item .item.smog .icon{cursor:pointer;background-position:0 -239px}#layerbox_item .smog.active .icon{background-position:0 -288px}#layerbox_item .item.traffic .icon{background-position:2px -140px}#layerbox_item .traffic.active .icon{background-position:2px -175px}#layerbox_item .pano .icon{background-position:11px -53px}#layerbox_item .pano.active .icon{background-position:11px -82px}#layerbox_item .ranging .icon{background-position:2px -423px}#layerbox_item .ranging.active .icon{background-position:2px -458px}#layerbox_item .satellite .icon{background-position:4px 1px}#layerbox_item .satellite.active .icon{background-position:4px -34px}#layerbox_item .lushu.active .icon{background:url(/assets/img/tools_img/icon_lushu_select.png) left center no-repeat}#layerbox_item .livephoto .icon{background-position:2px -70px}#layerbox_item .livephoto.active .icon{background-position:2px -106px}#layerbox_item .subway .icon{background-position:3px -493px}#layerbox_item .subway.active .name{color:#565656}#layerbox_item .pm25 .icon{background-position:11px -168px}#layerbox_item .pm25.active .icon{background-position:11px -197px}#layerbox_item .faves .icon{background-position:2px -565px}#layerbox_item .faves.active .icon{background-position:2px -601px}#layerbox_item .item.more_item{position:relative}#layerbox_item .item.more_item>.icon{text-align:center;background-position:2px -210px}#layerbox_item .item.more_item.active .icon{background-position:2px -246px}#layerbox_item .roadnet{position:absolute;opacity:0;padding:13px 0;z-index:-1;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px;left:-84px;top:0;background:#fff;box-shadow:1px 2px 1px rgba(0,0,0,.15);cursor:pointer;display:none}#layerbox_item .roadnet .raod_item{height:19px;line-height:19px;color:#565656;font-size:12px;display:inline-block;padding:0 10px;vertical-align:middle;cursor:pointer}#layerbox_item .hide-list{position:absolute;display:none;top:49px;right:66px;background-color:#fff;padding:0 6px 8px;z-index:3;box-shadow:1px 1px 1px rgba(0,0,0,.15);-webkit-border-radius:1px;-moz-border-radius:1px;-o-border-radius:1px;border-radius:1px;border:1px solid #ddd}#layerbox_item .hide-list .item{background-color:#fff;display:inline-block;border-right:0;padding:13px 0 4px;width:46px;height:auto;text-align:center;float:left;color:#565656}#layerbox_item .hide-list .item .icon-c{width:32px;height:32px;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;border:1px solid #eaeaea;text-align:center}#layerbox_item .hide-list .item .icon-c .icon{margin:6px 0 0 1px}#layerbox_item .hide-list .item .name{margin-top:4px}#layerbox_item .boxpanel{position:absolute;top:58px;right:0;width:310px;background:#FFF;border-radius:3px}.roadnet .roadnet_select_icon{display:inline-block;vertical-align:middle;background:url(/assets/img/tools_layer_new.png?v=2) 0 -434px no-repeat;width:22px;height:20px;margin-right:5px}.roadnet.checked .roadnet_select_icon{background-position:0 -483px}.traffic_level{float:left;margin:11px 6px 0}.traffic_level li{float:left;width:25px;margin:0 1px;height:6px}.traffic_level li.level_1{background:#34b000}.traffic_level li.level_2{background:#fecb00}.traffic_level li.level_3{background:#df0100}.traffic_level li.level_4{background:#8e0e0b}.traffic_wrap .time_lbl{color:#999}.traffic_wrap .date,.traffic_wrap .week{padding:0 6px}.select_week{margin:20px 0 10px;zoom:1}.select_week .time_lbl,.select_week .time_week{float:left}.select_week .time_week li{float:left;margin-left:20px;cursor:pointer}.select_week .time_week li.select{color:#0f89f5}.select_time{zoom:1}.select_time .time_lbl{float:left;line-height:42px}.select_time .time_time{float:left;width:252px;height:42px;margin-left:20px;background:url(/assets/img/time_select.png) 0 -28px no-repeat}.select_time .time_drag{height:30px;margin:0 auto}.ranged{line-height:0;position:relative;width:244px;top:14px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}#amap-banner,#amap-banner-entry,#amapbox,#maptoolbox,.mainbox,.ranged-thumb,.thumb-time-wrap,.thumb-time-wrap .thumb-time{position:absolute}.icon-add,.icon-reduce,.unselected,.usel{-webkit-user-select:none;-moz-user-select:none;-o-user-select:none}.ranged-bar{display:inline-block;height:100%}.ranged-thumb{display:inline-block;height:19px;width:11px;background:url(/assets/img/time_select.png) -1px -1px no-repeat;outline:0;margin-left:-5px;cursor:pointer}#locbox,#scalebox{background:#fff;border-radius:3px}.thumb-time-wrap{font-size:12px;top:-6px;left:-100%;color:#0f89f5}#indexbox .relative,#themap,body{position:relative}#maptoolbox{left:calc(100% - 48px);top:calc(100% - 132px);height:122px}#maptoolbox .dragtop{cursor:move;top:-10px;left:0;height:10px;width:100%}#maptoolbox .dragbottom{cursor:move;bottom:-10px;left:0;height:10px;width:100%}#maptoolbox .dragleft{cursor:move;top:0;left:-10px;width:10px;height:100%}#maptoolbox .dragright{cursor:move;right:-10px;top:0;width:10px;height:100%}#locbox{width:33px;height:33px;cursor:pointer}#locbox .locating{padding:8.5px;width:16px;height:16px}#locbox .locicon .icon{width:17px;height:17px;padding:8px;fill:#646464;cursor:pointer}#locbox .locicon.locok .icon{fill:#0091ff}#scalebox{width:29px;height:73px;margin-top:16px;padding:0 2px}#scalebox .zoom_map{width:24px;height:16px;margin:0 auto;padding:10px 0;background:url(/assets/img/scale.png) no-repeat;cursor:pointer}#scalebox .zoom_map.zoom_in_map{border-bottom:1px #dfdfdf solid;background-position:-3px 3px}#scalebox .zoom_map.zoom_out_map{background-position:-3px -156px}#scalebox .zoom_map.zoom_unable{background:url(/assets/img/scale_unable.png) no-repeat;cursor:default}#scalebox .zoom_in_map.zoom_unable{background-position:-3px 3px}#scalebox .zoom_out_map.zoom_unable{background-position:-3px -156px}#locTip .jBox-container,#locTip .jBox-pointer:after{background:rgba(0,0,0,.8)}.loc_tip .loc_tip_title{color:#fff}.amap-controls .amap-indoormap-floorbar-control{right:19px!important}.amap-controlbar{transform:scale(.7);bottom:130px!important;right:-7px!important}.sufei-dialog-close{display:none}.icon-add,.icon-reduce,.unselected{-khtml-user-select:none;user-select:none}.ellipsis{text-overflow:ellipsis;white-space:nowrap;display:inline-block}#indexbox .blue{color:#0f89f5}#indexbox .none{display:none}#indexbox button,.button{line-height:normal;background-color:#559ffb;border:none;border-radius:2px;color:#FFF;font-size:14px}.transit{-webkit-transition:all .2s;-moz-transition:all .2s;-o-transition:all .2s;transition:all .2s}.flex{display:-webkit-box;display:-moz-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex}.zdeps-1{box-shadow:0 2px 2px rgba(0,0,0,.15)}.zdeps-2{-webkit-box-shadow:0 2px 6px 0 rgba(0,0,0,.2),0 2px 6px 0 rgba(0,0,0,.19);-moz-box-shadow:0 2px 6px 0 rgba(0,0,0,.2),0 2px 6px 0 rgba(0,0,0,.19);box-shadow:0 2px 6px 0 rgba(0,0,0,.2),0 2px 6px 0 rgba(0,0,0,.19)}.zdeps-3{box-shadow:1px -1px 6px rgba(0,0,0,.3)}.usel{-ms-user-select:none;user-select:none}.sep{display:inline-block;vertical-align:baseline;border-right:1px solid #e1e1e1;height:12px;margin:0 4px}.clearfix:after{content:'\0020';display:block;height:0;clear:both}body{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACu5JREFUeNrs3MGN4lAQBFB7IyMzTGZkxmImAdNqfRWt9yTf+jKuQ8lIU9vr9douPIe7JXcv70Ue7uQhD3eVPP5tAMDPU+gAoNABAIUOACh0AEChA4BCBwAUOgDQaD//ad1riHF/Pw+vQR7IQx58nYfFHctL7uQhD3fysBQHAARQ6ACg0AEAhQ4AKHQAQKEDgEIHABQ6ANDIUlwWy0vyQB7yoJaHxR3LS+7kIQ938rAUBwAEUOgAoNABAIUOACh0AEChA4BCBwAUOgDQyFJcFstL8kAe8qCWh8Udy0vu5CEPd/KwFAcABFDoAKDQAQCFDgAodABAoQOAQgcAFDoA0MhSXBbLS/JAHvKglofFHctL7uQhD3fysBQHAARQ6ACg0AEAhQ4AKHQAQKEDgEIHABQ6ANBoylLc7f08B/wdU5aX5CEPechDHqvzsLhjecmdPOThTh6W4gCAAAodABQ6AKDQAQCFDgAodABQ6ACAQgcAGk1ZiptiyvKSPJCHPFidh8Udy0vu5CEPd/KwFAcABFDoAKDQAQCFDgAodABAoQOAQgcAFDoA0MhSXBbLS/JAHvKglofFHctL7uQhD3fysBQHAARQ6ACg0AEAhQ4AKHQAQKEDgEIHABQ6ANDIUlwWy0vyQB7yoJaHxR3LS+7kIQ938rAUBwAEUOgAoNABAIUOACh0AEChA4BCBwAUOgDQyFJcFstL8kAe8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QyFJcFstL8kAe8qCWh8Udy0vu5CEPd/KwFAcABFDoAKDQAQCFDgAodABAoQOAQgcAFDoA0Gj/LAMAAD//hb5feB7ultxt3os83MlDHu4qefjJHQCGfKEDAAodAFDoAIBCBwAUOgAodABAoQMATc6luMNriHHf/kYEkAfykAff5XEuv154DndL7l7eizzcyUMe7ip5+MkdAAZQ6ACg0AEAhQ4AKHQAQKEDgEIHABQ6ANDIUlwWy0vyQB7yoJaHxR3LS+7kIQ938rAUBwAEUOgAoNABAIUOACh0AEChA4BCBwAUOgDQyFJcFstL8kAe8qCWh8Udy0vu5CEPd/KwFAcABFDoAKDQAQCFDgAodABAoQOAQgcAFDoA0MhSXBbLS/JAHvKglofFHctL7uQhD3fysBQHAARQ6ACg0AEAhQ4AKHQAQKEDgEIHABQ6ANBoylLc7f08B/wdU5aX5CEPechDHqvzsLhjecmdPOThTh6W4gCAAAodABQ6AKDQAQCFDgAodABQ6ACAQgcAGk1ZiptiyvKSPJCHPFidh8Udy0vu5CEPd/KwFAcABFDoAKDQAQCFDgAodABAoQOAQgcAFDoA0MhSXBbLS/JAHvKglofFHctL7uQhD3fysBQHAARQ6ACg0AEAhQ4AKHQAQKEDgEIHABQ6ANDIUlwWy0vyQB7yoJaHxR3LS+7kIQ938rAUBwAEUOgAoNABAIUOACh0AEChA4BCBwAUOgDQyFJcFstL8kAe8qCWh8Udy0vu5CEPd/KwFAcABFDoAKDQAQCFDgAodABAoQOAQgcAFDoA0Gj/LAMAAD/tvwADACFZc/6Ic+VNAAAAAElFTkSuQmCC) #FCF9F2;min-width:960px;min-height:500px}#themap{height:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5U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t3Vd5GHO3nIw90kD0/uAFBAoQOAQgcAFDoAoNABAIUOAAodAFDoAMAiS3FZLC/JA3nIg1EeluKy7iwvycOdPOThbpSHJ3cAKKDQAUChAwAKHQBQ6ACAQgcAhQ4AKHQAYJGluCyWl+SBPOTBKA9LcVl3lpfk4U4e8nA3ysOTOwAUUOgAoNABAIUOACh0AEChA4BCBwAUOgCwyFJcFstL8kAe8mCUh6W4rDvLS/JwJw95uBvl4ckdAAoodABQ6ACAQgcAFDoAoNABQKEDAAodAFjUshT3+fz9FPwdLctL8pCHPOQhj5PzsBSXdWd5SR7u5CEPd6M8PLkDQAGFDgAKHQBQ6ACAQgcAFDoAKHQAQKEDAItaluJatCwvyQN5yIOT87AUl3VneUke7uQhD3ejPDy5A0ABhQ4ACh0AUOgAgEIHABQ6ACh0AEChAwCLLMVlsbwkD+QhD0Z5WIrLurO8JA938pCHu1EentwBoIBCBwCFDgAodABAoQMACh0AFDoAoNABgEWW4rJYXpIH8pAHozwsxWXdWV6Shzt5yMPdKA9P7gBQQKEDgEIHABQ6AKDQAQCFDgAKHQBQ6ADAIktxWSwvyQN5yINRHpbisu4sL8nDnTzk4W6Uhyd3ACig0AFAoQMACh0AUOgAgEIHAIUOACh0AGDRsRR39xkA4L39E2AAdhk/ILAOHTMAAAAASUVORK5CYII=)!important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}#search-panel:after{content:'';position:absolute;bottom:0;left:0;width:400px;height:2em;background:linear-gradient(rgba(255,255,255,0),rgba(255,255,255,1));pointer-events:none;z-index:99999}#themap.amap-container{background:0 0}#themap.themap_theme{background-image:none!important}.mainbox{left:15px;top:15px;z-index:2001}#amapbox{z-index:2000;left:15px;top:66px;width:400px;display:none}#amap-panels{background:#fff;position:relative;width:100%;opacity:.94}#amap-banner-entry{left:0;bottom:0;width:56px;height:66px;border-top:1px solid transparent;background:url(/assets/img/sqrcode2.png) 8px 10px no-repeat;cursor:pointer;z-index:1010}#amap-banner-entry:hover{background-color:#fff;border-top:1px solid #f4f5f6}#amap-banner-entry:hover #amap-banner{display:block}#amap-banner{display:none;z-index:1008;bottom:0;left:55px;background:#fff}#alibaba{display:none;text-align:center;margin:8px 8px 2px;color:#999}#mobileenterance{position:relative;background:url(/assets/img/amap_banner.png?v=3) center center no-repeat;width:344px;height:100px;border:1px solid #f4f5f6}#mobileenterance_no_bg{position:relative;background:url(/assets/img/app_banner.png) 96px center no-repeat #fbfbfb;background-size:160px 65px;height:95px}#mobileenterance a,#mobileenterance_no_bg a{position:absolute;color:#333;right:22px;width:70px;height:20px;text-align:center;line-height:20px;text-decoration:none;border-radius:3px;cursor:pointer}#mobileenterance .bannerQrcode,#mobileenterance_no_bg .bannerQrcode{vertical-align:middle;position:absolute;width:65px;height:65px;top:15px;left:22px}.app_banner{position:absolute;width:160px;height:65px;top:16px;left:96px}.amap-panctrl,.amap-search-panctrl{z-index:-10;position:absolute;height:24px;left:0;display:none;cursor:pointer;overflow:hidden;text-align:center}#mobileenterance .android,#mobileenterance_no_bg .android{bottom:20px;color:#6ccfaf;border:1px solid #6ccfaf}#mobileenterance .android:hover,#mobileenterance_no_bg .android:hover{background-color:#6ccfaf;color:#fff}#mobileenterance .ios,#mobileenterance_no_bg .ios{top:20px;color:#8c989f;border:1px solid #8c989f}#citybox,#citybox .city-title{border-bottom-left-radius:3px}#mobileenterance .ios:hover,#mobileenterance_no_bg .ios:hover{background-color:#8c989f;color:#fff}.amap-panctrl{width:100%;background:url(/assets/img/panctrl.png) center center no-repeat}.amap-search-panctrl{background-color:#fff;padding:12px 10px 5px;width:340px;font-size:14px;box-shadow:1px 2px 1px rgba(0,0,0,.1);color:#0f89f5}#citybox,#citybox .weather-box{box-shadow:0 2px 2px rgba(0,0,0,.15);position:absolute;background:#fff}.amap-panctrl-down,.amap-panctrl-up{bottom:-20px}.amap-panctrl .fa{padding:2px 40px}.amap-panctrl .fa:hover{color:#0091ff}#citybox{top:15px;left:395px;z-index:1100;border-top-left-radius:3px;color:#5f6477}#citybox .city-title{padding:14px 8px;background:#fff;cursor:pointer;display:inline-block;min-width:36px;height:17px;border-top-left-radius:3px}#citybox .city-title .iconfont{font-size:12px;display:inline-block}#citybox .city-title.active,#citybox .city-title:hover{color:#0091ff}#citybox .city-title.active .iconfont{-webkit-transform:rotate(-180deg);-moz-transform:rotate(-180deg);-ms-transform:rotate(-180deg);transform:rotate(-180deg)}#citybox .city-panel{z-index:1999;top:48px;left:0}#layerbox .city-panel{display:none;z-index:1999;top:38px;right:-6px}#citybox .weather-box{display:inline-block;text-align:center;height:45px;z-index:-1;top:0;border-bottom-right-radius:3px;border-top-right-radius:3px}#citybox .weather-item{display:inline-block;vertical-align:middle}#citybox .weather-info{padding:6px 8px 0 10px;margin-top:-1px;display:none;white-space:nowrap}#citybox .weather-info img.fa-spin{margin:10px 0}#citybox .air-quality{font-size:13px;cursor:pointer;padding-right:5px;margin-left:3px}#citybox .air-quality.active{color:#009cf9}#citybox .air-quality .icon-wumai{font-size:24px;vertical-align:middle;padding-left:10px;border-left:1px dashed #000}#exitFullscreen,.exitLushu{padding:0 14px;box-shadow:1px 2px 1px rgba(0,0,0,.15)}#exitFullscreen{position:absolute;top:15px;right:15px;line-height:46px;height:46px;color:#565656;font-size:13px;z-index:1100;background:#fff;border-radius:3px;cursor:pointer;display:none}#exitFullscreen:hover{color:rgba(109,120,145,.6)}.exitLushu,.lushu_fb_qa a{color:#5f6477;cursor:pointer}.lushu_ctrl{position:absolute;top:15px;right:90px;display:none}.lushu_fb_qa{background:#fff;border-radius:3px;float:left;margin-right:12px;box-shadow:1px 2px 1px rgba(0,0,0,.15)}.lushu_fb_qa a{display:block;float:left;height:46px;width:46px;font-size:13px;text-align:center;background-size:50%;background-repeat:no-repeat;background-position:center}.exitLushu span,.lushu_fb_qa a span{display:inline-block}.lushu_fb_qa a.lushu_fb{background-image:url(/assets/img/icon_feedback.png)}.lushu_fb_qa a.lushu_qa{background-image:url(/assets/img/icon_help.png)}.lushu_fb_qa a.lushu_intro{background-image:url(/assets/img/icon_intro.png);background-size:45%}.lushu_fb_qa a span{height:28px;width:46px;border-right:1px #d5dce0 dashed;line-height:28px;margin-top:9px;text-indent:-999px;overflow:hidden}.exitLushu,.exitLushu span{height:46px;line-height:46px;float:left}.lushu_fb_qa a:last-child{margin-left:1px}.lushu_fb_qa a:last-child span{border:0}.lushu_fb_qa a:hover{text-decoration:none;background:#f8f8f8}.lushu_fb_qa a:hover span{text-indent:0}.exitLushu{border-radius:3px;background:#fff}.exitLushu span .iconfont{font-size:20px;margin-right:6px}.loc_icon{width:16px;height:16px;border:2px solid #fff;background-color:#0f89f5;-moz-border-radius:50%;-webkit-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;box-shadow:2px 2px 2px rgba(0,0,0,.15)}.ripple{position:relative;width:40px;height:40px}.ripple i{position:absolute;top:50%;left:50%;border-radius:50%;background:#fff;opacity:0}#amap-panels>div,#layerbox1,#nav li{position:relative}#amap-result-banner{margin:0 auto}#amap-result-banner #mobileenterance{width:315px;border:1px solid #f4f5f6}#amap-result-banner .active-banner img{height:97px;width:100%}#amap-panels>div{display:none;background:#fff;width:100%}#amap-links,#nav{position:absolute;overflow:hidden}#amap-links{z-index:1002;width:345px;bottom:0;right:0;background:#fff;text-align:center;border-top:1px solid #f4f4f4}#amap-links>a{color:#999;display:inline-block;padding:6px}#nav{width:55px;background-color:#f4f5f6;height:100%;z-index:9999}#nav li{width:55px;height:55px;padding-top:7px;text-align:center;cursor:pointer}#nav li .fa{font-size:20px;color:#b1b2b3;display:block}#nav li .nav-txt{font-size:12px;line-height:12px;height:12px;color:#737475}#nav .active .dirico,#nav .dirico,#nav li:hover .dirico{width:18px;height:20px;margin:0 18.5px;display:inline-block}#nav li.active,#nav li:hover{background-color:#fff}#nav li.active .fa,#nav li.active .nav-txt,#nav li:hover .fa,#nav li:hover .nav-txt{color:#1b8cfb}#nav .dirico{background:url(/assets/img/indexicon/dir.png) center center no-repeat}#nav .active .dirico,#nav li:hover .dirico{background:url(/assets/img/indexicon/dir-active.png) center center no-repeat}#nav .starico{display:inline-block;width:21px;height:21px;margin:0 17px;background:url(/assets/img/favstar.png) no-repeat;overflow:hidden}#layerbox .hide-list .item.smog,.boxpanel{display:none}#nav .active .starico,#nav li:hover .starico{background-position:-21px 0}body .is-dragging{z-index:199999}.boxpanel{padding:12px}.boxpanel .panel_header{height:30px}.boxpanel .panel_body{margin-top:10px}.boxpanel .panel_header .panel_tab{float:left;height:28px;line-height:28px;border:1px solid #0f89f5;border-radius:2px}.boxpanel .panel_header .panel_tab li{float:left;padding:0 10px;color:#0f89f5;font-size:14px;cursor:pointer}.boxpanel .panel_header .panel_tab li.active{background:#0f89f5;color:#FFF}.boxpanel .panel_header .traffic_tag{float:right;line-height:30px}.boxpanel .panel_header .traffic_tag span{float:left;font-size:14px}#layerbox1{float:right;width:90px;background:#FFF;border-radius:2px}#layerbox1 .layer_item1{line-height:30px;text-align:right;padding:0 2px;cursor:pointer;width:90px;background:url(/assets/img/tools_layer_new.png) no-repeat #FFF;position:absolute}#layerbox1 .layer_item1 span{padding-right:10px}#layerbox1 .layer_item1 .roadnet{display:none;border-top:1px #e5e5e5 solid;background:url(/assets/img/tools_layer_new.png) 7px -280px no-repeat #fff}#layerbox1 .layer_item1 .roadnet.select{background-position:7px -305px}#layerbox1 .layer_item1 .layer_mask{position:absolute;top:0;left:0;width:100%;height:100%;background:#000;opacity:.2}#layerbox1 .layer_item1.two_d{background-position:2px -220px}#layerbox1 .layer_item1.three_d{background-position:2px -249px}#layerbox1 .layer_item1.up{z-index:3}#layerbox1 .layer_item1.down{z-index:2}#toolbox{position:absolute;bottom:10px;right:100px;z-index:1999;background:#fff;border-radius:2px;height:30px}.ranging .icon{background-position:11px 2px}.ranging.active .icon{background-position:11px -121px}.mark .icon{background-position:10px -22px}.screenshot .icon{background-position:11px -46px}#layerbox .fullscreen.notfull .icon{border:0;background-position:2px -282px}#layerbox .fullscreen.full .icon{border:0;background-position:0 -320px}.flipY{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.flyme{position:absolute;z-index:100000;font-size:18px;color:#4787ed}.loc_edit{color:#3a84df}#loginTip .jBox-pointer-bottom:after{bottom:8px;left:10px}#loginTip.login-tip-hide{display:none!important}.recommend_entry{display:none;position:absolute;width:230px;height:252px;background:url(/assets/img/lushu_entry.png) #4a90e2;background-size:230px 252px;right:0;top:58px;border-radius:3px;box-shadow:1px 2px 1px rgba(0,0,0,.15);cursor:pointer}.recom_close{position:absolute;width:24px;height:24px;top:6px;right:8px;z-index:10;color:#fff;cursor:pointer;text-align:center}.recommend_entry:before{content:"";position:absolute;top:-4px;right:18px;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #4a90e2;border-top:0}.amap-scalecontrol.scalecontrol_theme{color:#fff}.city-default,.city-panel-close:hover{color:#0f89f5}.fav_marker_outer{position:absolute;width:16px;height:16px;margin-top:-8px;margin-left:-8px;z-index:-10}.citypicker-autocomplete-suggestions{border:1px solid #e1e1e1;background:#FFF;overflow:auto}.citypicker-autocomplete-suggestions .autocomplete-suggestion{padding:2px 5px;white-space:nowrap;overflow:hidden;background:#fff;text-indent:0}.citypicker-autocomplete-suggestions .autocomplete-selected{background:#f1f1f1}.citypicker-autocomplete-suggestions strong{font-weight:400;color:#0f89f5}.citypicker-autocomplete-suggestions .autocomplete-group{padding:2px 5px}.citypicker-autocomplete-suggestions .autocomplete-group strong{display:block;border-bottom:1px solid #000}.city-header{position:relative;line-height:36px;border-bottom:1px solid #cbcccd}.city-current{font-size:14px;font-weight:700}.city-panel-close{position:absolute;right:0;cursor:pointer;font-size:1.2em}.city-default{margin-left:20px;cursor:pointer;display:none}.city-hotlist{overflow:hidden;margin-top:5px;margin-bottom:6px}.city-hotlist li{float:left;margin-right:10px;color:#42a5f5;cursor:pointer}.city-hotlist li:hover{text-decoration:underline;color:#1e88e5}.city-sug{margin-top:-1px;margin-left:-6px}.city-pc-title{width:48%;display:inline-block;border:1px solid #cbcccd;border-bottom:none;border-radius:2px}.city-pc-title .city-select{background-color:#fff;border-bottom:none}.city-pc-title span{width:50%;display:inline-block;text-align:center;border-bottom:1px solid #cbcccd;cursor:pointer;background-color:#f7f7f7}.city-city-title{border-left:1px solid #cbcccd}.city-search{width:48%;margin-left:4%;display:inline-block;position:relative}.city-search input{border:1px solid #cbcccd;padding:5px 0 5px 34px;width:100%;border-radius:2px}.city-search-logo{left:6px;position:absolute}.city-city-letter,.city-province-letter{margin-top:10px;white-space:normal}.city-city-letter li,.city-province-letter li{display:inline-block;background-color:#F5F5F5;margin-left:6px;cursor:pointer;line-height:18px;width:18px;text-align:center}.city-city-letter li:hover,.city-letter-select,.city-province-letter li:hover{background-color:#0f89f5!important;color:#fff}.city-city-list,.city-province-list{display:none}.city-list>div{display:block}.city-list dl{margin:4px 0;position:relative}.dtrigger,.search{position:absolute}.city-list dl dt{float:left;font-weight:700;line-height:20px}.city-list dl dd{white-space:normal;line-height:20px;margin-bottom:8px}.city-list .city-city dd{margin:0 0 0 25px}.city-list dl dd li{display:inline-block;margin-right:9px;cursor:pointer;color:#999}.city-list dl dd li:hover{color:#0f89f5}.dtrigger{z-index:99999;cursor:move}.search{z-index:6201;left:15px;top:15px}.search .dragtop{top:-3px;left:0;height:10px;width:100%}.search .dragbottom{bottom:0;left:0;height:10px;width:100%}.search .dragleft{top:0;left:0;width:10px;height:100%}.search .dragright{right:0;top:0;width:10px;height:100%}.amap0{background-color:#4d90fe;background-image:-webkit-linear-gradient(top,#4d90fe,#4787ed)}.amap1{background-color:#0f89f5;background-image:-webkit-linear-gradient(top,#0f89f5,#1283e5);background-image:-moz-linear-gradient(top,#0f89f5,#1283e5);background-image:-o-linear-gradient(top,#0f89f5,#1283e5);background-image:linear-gradient(top,#0f89f5,#4787ed)}.amap2{background-color:#1386eb;background-image:-webkit-linear-gradient(top,#1386eb,#0f89f5)}.amap3{background-color:#157cd6;background-image:-webkit-linear-gradient(top,#157cd6,#0f89f5)}.amap4{background-color:#188ef5;background-image:-webkit-linear-gradient(top,#188ef5,#0f89f5)}.amap5{background-color:#198bfc;background-image:-webkit-linear-gradient(top,#198bfc,#1885f2)}.amap6{background-color:#327ffa;background-image:-webkit-linear-gradient(top,#327ffa,#186bf0)}.amap7{background-color:#4590e5;background-image:-webkit-linear-gradient(top,#4590e5,#4992f2)}.amap8{background-color:#1283e6}.searchboxshadow.round{border-radius:3px!important}.searchbox{position:relative;z-index:2201;width:360px;height:45px;background:#fff;box-shadow:0 2px 2px rgba(0,0,0,.15);border-radius:3px}.searchbox .logo{display:block;position:absolute;top:6px;left:8px;width:34px;height:34px;z-index:99999;cursor:pointer}.searchbox .iptbox{position:absolute;left:50px;top:0;width:265px;height:45px;box-sizing:border-box;z-index:2202;border-radius:2px}.searchbox #nearby,.searchbox #nearbybox{position:absolute;top:0;width:310px;height:45px;box-sizing:border-box}.searchbox #nearbybox{left:50px;z-index:2210;background:#fff;display:none}.searchbox #nearby{left:0;transition:width .2s ease;font-size:14px}.searchbox #nearbyipt{position:relative;top:12.5px;box-sizing:border-box;text-indent:2px;border:none;height:20px;line-height:20px;padding:0;width:120px}.searchbox #nearbyclosewrap{width:45px;height:45px;position:absolute;right:0;top:0;background-color:#f8f8f8;border-radius:0 2px 2px 0}.searchbox #nearbyclose{position:absolute;top:8.5px;right:10px;font-size:15px;padding:3px 5px;cursor:pointer}.searchbox #nearbybtn{position:absolute;right:45px;top:0;z-index:9308;box-sizing:border-box;width:45px;height:45px}.searchbox #nearbybtn .nearbylogo{position:absolute;top:8.5px;right:8px;font-size:19px;color:#919095;padding:0 5px}.searchbox #nearbybtn .nearbylogo:hover{color:#70b9f9;cursor:pointer}.searchbox #nearbyloading{position:absolute;top:8px;right:10px;z-index:2215;display:none}.searchbox #nearby span{position:relative;top:12.5px;color:#aaa}.searchbox #nearby .poiname{color:#333}#searchloading{position:absolute;top:15px;right:16px;z-index:2212;display:none}.searchbox #searchipt{position:absolute;top:12.5px;left:0;box-sizing:border-box;text-indent:2px;z-index:2200;border:none;width:219px;height:20px;line-height:20px;padding:0;letter-spacing:.5px;font-size:14px}.searchbox #searchipt::-webkit-input-placeholder{font-size:14px;color:#b7b8b9;font-weight:200;letter-spacing:1px;opacity:.8!important}.searchbox .direntry:hover,.themex .searchbox .searchlogo:hover{opacity:.8}.searchbox .iptbox #searchipt:-moz-placeholder{font-size:13px;color:#b7b8b9;font-weight:200;letter-spacing:1px}.searchbox .iptbox #searchipt::-moz-placeholder{font-size:13px;color:#b7b8b9;font-weight:200;letter-spacing:1px}.searchbox .iptbox #searchipt:-ms-input-placeholder{font-size:13px;color:#b7b8b9;font-weight:200;letter-spacing:1px}.searchbox .iptbox input::selection{background:rgba(94,165,247,.3)}.searchbox .iptbox input::-moz-selection{background:rgba(94,165,247,.3)}.searchbox .iptbox #searchbtn{position:absolute;right:0;top:0;z-index:9308;box-sizing:border-box;width:45px;height:45px}.searchbox .searchlogo{position:absolute;top:8.5px;right:8px;font-size:19px;color:#7c8196;padding:0 5px}.searchbox .searchlogo:hover{color:#42a5f5;cursor:pointer}.searchbox .direntry{width:45px;height:45px;position:absolute;right:0;top:0;text-align:center;background-color:#f8f8f8;border-radius:0 3px 3px 0}.searchbox .direntry .close-btn{position:absolute;top:8.5px;right:10px;font-size:15px;display:none;padding:3px 5px;cursor:pointer}.searchbox .direntry.in-main{background:#fff}.searchbox .direntry.in-dir .close-btn,.searchbox .direntry.in-main .close-btn{display:inline-block;color:#78909c}.searchbox .direntry.in-main .close-btn:hover{color:#90a4ae}.themex .searchbox,.themex .searchbox .searchlogo{color:#fff}.searchbox .direntry .fa-dir{position:absolute;top:9px;right:9px;width:16.5px;height:18px;padding:5px;cursor:pointer}.searchbox .direntry.in-dir .fa-dir,.searchbox .direntry.in-main .fa-dir{display:none}.searchbox #separator{position:absolute;right:38px;top:11px;height:24px;width:1px;background:#ccc}.main-sug.autocomplete-suggestions{margin-top:-5px;background:#fff;top:50px;left:0;border:none;border-top:1px solid #E4E6E7;box-shadow:1px 2px 1px rgba(0,0,0,.15);border-radius:0 0 2px 2px;max-width:360px}.main-sug .autocomplete-suggestion p{margin-right:12px}.main-sug .autocomplete-suggestion p strong{font-weight:400}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.ring{height:13px;width:13px;border:0 solid #ccc;border-radius:100%;border-bottom-color:transparent;border-width:1px;background:0 0;-webkit-animation:fa-spin 1s infinite linear;animation:fa-spin 1s infinite linear;-webkit-font-smoothing:subpixel-antialiased}.themex .searchbox,.themex .searchbox #searchipt{background:#0f89f5}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.themeA .searchbox .iptbox{border:none;border-radius:0;border-bottom:1px solid #dbdbdb}.themeA .searchbox .iptbox.active{border-bottom:1px solid #9cccf6}.themex .searchbox .iptbox{border:none;border-radius:0;border-bottom:1px solid #fff}.themex .searchbox #searchipt::-webkit-input-placeholder{color:#fff}.themex .searchbox .iptbox #searchipt:-moz-placeholder{color:#fff}.themex .searchbox .iptbox #searchipt::-moz-placeholder{color:#fff}.themex .searchbox .iptbox #searchipt:-ms-input-placeholder{color:#fff}.themex #searchloading{border:0 solid #fff;border-bottom-color:transparent;border-width:2px}.activity_wrap{width:360px;margin:10px 0}.activity_wrap img{width:330px;display:block;margin:0 auto 10px;cursor:pointer}.activity_wrap #amap-result-banner{width:330px;margin:0 auto}
171
+ </style>
172
+
173
+ <link rel="search" type="application/opensearchdescription+xml" href="/assets/opensearchnew.xml?v=1.1" title="高德地图" />
174
+
175
+ </head>
176
+ <body scroll="no">
177
+
178
+ <script type="text/javascript" id="beacon-aplus" src="//g.alicdn.com/alilog/mlog/aplus_v2.js" exparams="clog=o&aplus&sidx=aplusSidx&ckx=aplusCkx"></script>
179
+
180
+ <section id="search" class="search">
181
+ <header class="searchbox">
182
+ <img class="usel logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAAAXNSR0IArs4c6QAAF8pJREFUeAHtW2mUHNV1vlVdvU3PopHUGmnQMggQoA2xGWwWDY53O3ESTBacnDj+YTtO+JOc2Md/jHSynJDjYBI7OPExB+MFY5NzEjvEy4mAETGLkMTOsEQWAxIgGEmzdvdMd1e9fN99VdXVPa2ZkSAx8fEbVb3tvvvu/d69972qLon8Mv0SgfkQcObrPFGfMcYZl8PbfTGbgsBfLRKsdMXxTkTP9qx0T3W6y6ZOQJOq+n7fCfoW2xw4xhwNjDnsue7BVCr1E8dxZhY7OKI7KUBG6nuuLZmJz02bY+dWTTkVMVlMvia1TdalLmhL6geBjJVKbftOtdF1HANQXsL1ja5s9vOL5bMoQF4wD2+f9o/eNhEcWUvrWCzzJN3/NSDJuWExkxnP+2whl/unZHu7stuuMdl2wL//C6/Wnrl33H913amCkeT38yjXg6C7XK1+ZbJSuW8hHeb1+2fr995zxH9ucCEmPw8lT2XO2VrtCuhyGNdGxJeJdjxOaCHP13f/y6h/8KpfFDAi5av1ev9EpfJYVG/N2wJywH/wM68HB3+zlfgXpV6r1wemKpWftNNnDiDHzb6eY/7IXxkTnFLwbDfJW7Fttl5/d2lm5v2tss0BZNSfvh1b6ryxpZXJW7X+/Jgr33my/emAoQDB9pZW2ZsAoXUcDw69r5Xo/1v9wJgjf/SfOfnM91NycKo9INQJ8WRVeXb2d5L6NQMSVP+sbqpNbUnit3r54Lgjf7IrJ5d9uyCHDtZkuJqRbSuDecWGlVyXJGhyjdlg6reSnVHZmKiE/BQjC1kk2SQ4anvbvkSjM8+8L046cuPerHz3GU98jLk8XZKfOTkZm3Vk2wo/OdWcMk7JFyYbmwApm4nTk51v9fKhKUdu2puRbw+nFQjKe2WmJE+XMnIsnZKlOSOndSZQbaNQ3feziCercC55ld1NgNRkJh2NARGK4bLMszoRPXOOsaRtBpBdk2ygxbI3NSWZs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+dX/Q5TGh3FYuXqaXjTWDUIMkd7TKn2gikW1/tT1ddMfllgCvgPNiMjqyXfN2B6V0A3ussGfvLARGOwHx1qFbfUoLPDWfFpkdLogJT3iTOCxi3vEKnP4EOanx116pVJZ6ZrrXTjv8qnlosce3nGkeJqUxs96MwuWSU+PkleXug2Dt5aVafHpZwpYKU6TMYr8cWHyeCH7VrdkXq+03hVCJROmbyXCtxsB8JzDfahP2IEJmWCdL7gu34NtpENvFQBX295xjVHJeiqBfVqpy9+2XQsywfV4wBjfARgdDfAqAOMqTHTlc0EY5Ml6TrNN4U+3/SMrjaPkVaWmHwvYmVXP6xlSArlAbgLXvruJBQ7ZWhwkAUAMrjDkd0iFhSJQVmW3e/0rNlsJktLJDM65Kzs2irBywBlPT7IffkQQNlg8pXjkunodWawQpMOlrirKj3ZpUF1eho+XMM+UZOcswy/WJRMZxoAVCalNjMtMBbj4j/COH7OOGkPj072gl0YU60bt1bHrwBjxst6ASALzETFAD/0Lg/88XFxuoxfWJEPOG+ZlgEwxtG+ZKUfTMGielcWg0Jfl+k50G1GRvCD2NuWBL1d1jr2L+uHu9DqofMm3KD7jusHtc62/wHi3gbpiXrJnQAAAABJRU5ErkJggg==" draggable="false">
183
+ <div id="nearbybox">
184
+ <div id="nearby">
185
+ <span>在</span><span class="poiname">天安门...</span><span>周边搜</span>
186
+ <input type="text" id="nearbyipt" autocomplete="off" />
187
+ </div>
188
+ <div id="nearbyclosewrap">
189
+ <i id="nearbyclose" class="iconfont icon-close"></i>
190
+ </div>
191
+ <div id="nearbybtn">
192
+ <i class="iconfont icon-search nearbylogo"></i>
193
+ <span id="nearbyloading" class="ring"></span>
194
+ </div>
195
+ </div>
196
+
197
+ <div class="iptbox">
198
+ <input type="text" id="searchipt" placeholder="搜索位置、公交站、地铁站" maxlength="256" autocomplete="off" />
199
+
200
+ <div id="searchbtn" class="usel">
201
+ <i class="iconfont icon-search searchlogo icontip" title="搜索"></i>
202
+
203
+ <span id="searchloading" class="ring"></span>
204
+ </div>
205
+ </div>
206
+
207
+ <div class="direntry usel">
208
+ <img class="fa-dir icontip" title="路线" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAkCAYAAABxE+FXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RTdGRDQzNzk1MUE0MTFFNkJENThBRUM3QkJFQTlBNEMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RTdGRDQzN0E1MUE0MTFFNkJENThBRUM3QkJFQTlBNEMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpFN0ZENDM3NzUxQTQxMUU2QkQ1OEFFQzdCQkVBOUE0QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpFN0ZENDM3ODUxQTQxMUU2QkQ1OEFFQzdCQkVBOUE0QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrQHkWQAAAG5SURBVHja5Jg/KEVRHMfPfe+RpEgkw/MkUiKDwYCIRFGKzUp5A7IYrJJBBpNFPYmISGGQ9J56CwaDxWAji2LwL0We76nfIN0/597zx+BXn+Gdezqf3vnd3/mdrlWbyDDByAdp8AB6wBuTjJDgPAskQB1oA0s0ZkQ+Dvp//B4EUybkjWDOZnwG9OmUF4JNkO2QijVKhXI5X3wFxFzm5IE9UKxaPgl6BdYoBzsOuxNI3kQ5FY0WsKhCXgQ2QJbPtYbAhIyc53kVRAO+Q/OgK6ic1263RPWEqTqq/cpbwTSTD34MH4ACUXkJ5TnM1EQl2PZaL0QTeJ5LmdroAAtecp7nTqYnRkHcTT7G9Mas04MI5dsrMi5HsPaWqiX+rzxiYH1e81XU/Sro/TnjnVCXPEadrgHk2jxvBx+q5VG669UIzG1WJc8BA/RvLZM5LwMjdA/wE2lZeT0Y9nmFegGnYF9WHhco1ztwCa7BDXhWte1O4k9wDpLg1mSdX4F1cG/ykOGHxy44cmlEWuRfYJm22vjZvuVXrEp+AVJ/0dXe6eKptaU+2ozxLxPH4Em3/PDXZ5BX2uoTmW37FmAA/hxExSsxtXsAAAAASUVORK5CYII=" draggable="false">
209
+ <i class="close-btn iconfont icon-close"></i>
210
+ </div>
211
+ </header>
212
+ <div class="amap-search-panctrl">
213
+
214
+ </div>
215
+ <div class="dtrigger dragtop"></div>
216
+ <div class="dtrigger dragbottom"></div>
217
+ <div class="dtrigger dragleft"></div>
218
+ <div class="dtrigger dragright"></div>
219
+ </section>
220
+
221
+
222
+
223
+ <section id="amapBox" class="amap-box fs-box"></section>
224
+
225
+
226
+ <div class="serp-box-con fs-box">
227
+ <section id="serpBox" class="serp-box translate-box" data-slide-d="0"></section>
228
+ </div>
229
+
230
+ <section id="dirBox">
231
+ <div id="dirbox" class="dirbox"></div>
232
+ <div class="dtrigger dragtop"></div>
233
+
234
+ <div class="dtrigger dragleft"></div>
235
+ <div class="dtrigger dragright"></div>
236
+ </section>
237
+
238
+
239
+
240
+ <div id="loginbox" class="usel loginbox" ></div>
241
+
242
+
243
+ <div id="themap"></div>
244
+
245
+
246
+ <div id="maptoolbox" class="maptoolbox"></div>
247
+
248
+
249
+ <div id="layerbox" class="layerbox usel"></div>
250
+ <div id="exitFullscreen">退出全屏</div>
251
+ <div class="lushu_ctrl"></div>
252
+
253
+
254
+ <div class="dir_qr"></div>
255
+
256
+
257
+ <div class="iw_tmp" style="position:absolute;"></div>
258
+
259
+
260
+ <div id="livephotoshow"></div>
261
+
262
+
263
+ <div id="activity_box"></div>
264
+
265
+ <div id="planBox">
266
+ <div class="plan-list-c"></div>
267
+ <div class="plan-create-c"></div>
268
+ <div class="plan-detail-c"></div>
269
+ </div>
270
+
271
+ <div id="planSrhBox"></div>
272
+ <script>
273
+ // window.forbidenWebGL = true;
274
+ (function(){
275
+ var now = (new Date()).getTime();
276
+ var start = 1585929600000;
277
+ var end = 1586016000000;
278
+ if(now >= start && now < end){
279
+ var bodyElement = document.body;
280
+ bodyElement.setAttribute('class', 'grey-filter-theme');
281
+ }
282
+ })();
283
+ </script>
284
+ <script type='text/javascript'>
285
+ !function(a){window.amap={tileLayer:{}};var b,c={code:"0"},d=function(){var a=window.performance&&window.performance.now()||Date.now()-Tracker.fht;return parseInt(a)},e=function(a){try{var b=localStorage.getItem("newloc")||"{}",c=JSON.parse(b);c.cip&&localStorage.setItem("newloc_"+c.cip,c),c.time,localStorage.removeItem("newloc")}catch(a){console.log(a)}var d="newloc_"+(a||""),e=localStorage.getItem(d);return e=e?JSON.parse(e):{},e.time&&(e.code="1"),e},f=function(){var a="/service/locator?rand="+Math.random(),f=new XMLHttpRequest;f.overrideMimeType&&f.overrideMimeType("text/xml"),f.open("GET",a,!0),f.timeout=3e3,f.onreadystatechange=function(){if(4==f.readyState){if(window.Tracker.rt.rt_locend=d(),__WPO.speed(5),200==f.status){var a={};f.responseText&&(a=JSON.parse(f.responseText)),amap.cip=a.cip;var b=e(a.cip),h=b.time&&Date.now()-b.time<(b.duration||0),i=b.cip===amap.cip;b.lat&&i&&h?(a=b,console.log("[oriloc]")):a=g(a)}else a=c;amap.oriloc=a,window.loopCheckShowMap&&loopCheckShowMap()}},f.ontimeout=function(){var a=c;b&&b(a)},f.send(null)},g=function(a){return 1==a.code&&a.lng&&a.lat?(a.needDecode=1,a):"6"!=a.status?c:void(location.href="/verify/?from="+encodeURIComponent(location.href)+"&channel=PL")};!function(){window.Tracker.rt.rt_locstart=d(),__WPO.speed(3),f()}()}();
286
+ </script>
287
+ <script type="text/javascript">
288
+ window._AMapSecurityConfig = {
289
+ serviceHost:'/_AMapService',
290
+ // 例如 :serviceHost:'http://1.1.1.1:80/_AMapService',
291
+ }
292
+ </script>
293
+ <script src="//webapi.amap.com/maps?v=2.0&key=d1f15ad3fdf0c704434eaf23c7c18698&plugin=AMap.Adaptor"></script>
294
+ <script type='text/javascript' src='/build/map.a9d3913ec27e73540126.js'></script>
295
+ </body>
296
+ </html>
scrapy/gaode/gaode/__init__.py ADDED
File without changes
scrapy/gaode/gaode/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (196 Bytes). View file
 
scrapy/gaode/gaode/__pycache__/middlewares.cpython-311.pyc ADDED
Binary file (4.43 kB). View file
 
scrapy/gaode/gaode/__pycache__/settings.cpython-311.pyc ADDED
Binary file (2.81 kB). View file
 
scrapy/gaode/gaode/items.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Define here the models for your scraped items
2
+ #
3
+ # See documentation in:
4
+ # https://docs.scrapy.org/en/latest/topics/items.html
5
+
6
+ import scrapy
7
+
8
+
9
+ class GaodeItem(scrapy.Item):
10
+ # define the fields for your item here like:
11
+ # name = scrapy.Field()
12
+ pass
scrapy/gaode/gaode/middlewares.py ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Define here the models for your spider middleware
2
+ #
3
+ # See documentation in:
4
+ # https://docs.scrapy.org/en/latest/topics/spider-middleware.html
5
+
6
+ from scrapy import signals
7
+ from random import choice
8
+ from gaode.settings import USER_AGENT_LIST
9
+ # useful for handling different item types with a single interface
10
+ from itemadapter import is_item, ItemAdapter
11
+
12
+
13
+ class GaodeSpiderMiddleware:
14
+ # Not all methods need to be defined. If a method is not defined,
15
+ # scrapy acts as if the spider middleware does not modify the
16
+ # passed objects.
17
+
18
+ @classmethod
19
+ def from_crawler(cls, crawler):
20
+ # This method is used by Scrapy to create your spiders.
21
+ s = cls()
22
+ crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
23
+ return s
24
+
25
+ def process_spider_input(self, response, spider):
26
+ # Called for each response that goes through the spider
27
+ # middleware and into the spider.
28
+
29
+ # Should return None or raise an exception.
30
+ return None
31
+
32
+ def process_spider_output(self, response, result, spider):
33
+ # Called with the results returned from the Spider, after
34
+ # it has processed the response.
35
+
36
+ # Must return an iterable of Request, or item objects.
37
+ for i in result:
38
+ yield i
39
+
40
+ def process_spider_exception(self, response, exception, spider):
41
+ # Called when a spider or process_spider_input() method
42
+ # (from other spider middleware) raises an exception.
43
+
44
+ # Should return either None or an iterable of Request or item objects.
45
+ pass
46
+
47
+ def process_start_requests(self, start_requests, spider):
48
+ # Called with the start requests of the spider, and works
49
+ # similarly to the process_spider_output() method, except
50
+ # that it doesn’t have a response associated.
51
+
52
+ # Must return only requests (not items).
53
+ for r in start_requests:
54
+ yield r
55
+
56
+ def spider_opened(self, spider):
57
+ spider.logger.info("Spider opened: %s" % spider.name)
58
+
59
+
60
+ class GaodeDownloaderMiddleware:
61
+ # Not all methods need to be defined. If a method is not defined,
62
+ # scrapy acts as if the downloader middleware does not modify the
63
+ # passed objects.
64
+
65
+ @classmethod
66
+ def from_crawler(cls, crawler):
67
+ # This method is used by Scrapy to create your spiders.
68
+ s = cls()
69
+ crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
70
+ return s
71
+
72
+ def process_request(self, request, spider):
73
+ # Called for each request that goes through the downloader
74
+ # middleware.
75
+
76
+ # Must either:
77
+ # - return None: continue processing this request
78
+ # - or return a Response object
79
+ # - or return a Request object
80
+ # - or raise IgnoreRequest: process_exception() methods of
81
+ # installed downloader middleware will be called
82
+ return None
83
+
84
+ def process_response(self, request, response, spider):
85
+ # Called with the response returned from the downloader.
86
+
87
+ # Must either;
88
+ # - return a Response object
89
+ # - return a Request object
90
+ # - or raise IgnoreRequest
91
+ return response
92
+
93
+ def process_exception(self, request, exception, spider):
94
+ # Called when a download handler or a process_request()
95
+ # (from other downloader middleware) raises an exception.
96
+
97
+ # Must either:
98
+ # - return None: continue processing this exception
99
+ # - return a Response object: stops process_exception() chain
100
+ # - return a Request object: stops process_exception() chain
101
+ pass
102
+
103
+ def spider_opened(self, spider):
104
+ spider.logger.info("Spider opened: %s" % spider.name)
105
+
106
+ class MyRandomUserAgentMiddleware:
107
+
108
+ def process_request(self, request, spider):
109
+ UA = choice(USER_AGENT_LIST)
110
+ request.headers['User-Agent'] = UA
111
+ # 不要返回任何东西
112
+
113
+ def process_response(self, request, response, spider):
114
+ return response
115
+
116
+ def process_exception(self, request, exception, spider):
117
+ pass
scrapy/gaode/gaode/pipelines.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Define your item pipelines here
2
+ #
3
+ # Don't forget to add your pipeline to the ITEM_PIPELINES setting
4
+ # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
5
+
6
+
7
+ # useful for handling different item types with a single interface
8
+ from itemadapter import ItemAdapter
9
+
10
+
11
+ class GaodePipeline:
12
+ def process_item(self, item, spider):
13
+ return item
scrapy/gaode/gaode/settings.py ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Scrapy settings for gaode project
2
+ #
3
+ # For simplicity, this file contains only settings considered important or
4
+ # commonly used. You can find more settings consulting the documentation:
5
+ #
6
+ # https://docs.scrapy.org/en/latest/topics/settings.html
7
+ # https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
8
+ # https://docs.scrapy.org/en/latest/topics/spider-middleware.html
9
+
10
+ BOT_NAME = "gaode"
11
+
12
+ SPIDER_MODULES = ["gaode.spiders"]
13
+ NEWSPIDER_MODULE = "gaode.spiders"
14
+ LOG_LEVEL = 'WARNING'
15
+
16
+ # settings里添加
17
+ USER_AGENT_LIST = [
18
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36',
19
+ 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2919.83 Safari/537.36',
20
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2866.71 Safari/537.36',
21
+ 'Mozilla/5.0 (X11; Ubuntu; Linux i686 on x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2820.59 Safari/537.36',
22
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2762.73 Safari/537.36',
23
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2656.18 Safari/537.36',
24
+ 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/44.0.2403.155 Safari/537.36',
25
+ 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36',
26
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36',
27
+ 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36',
28
+ 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36',
29
+ 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2226.0 Safari/537.36',
30
+ 'Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36',
31
+ 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36',
32
+ 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2224.3 Safari/537.36',
33
+ 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36',
34
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36',
35
+ 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36',
36
+ 'Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36',
37
+ ]
38
+
39
+ # Crawl responsibly by identifying yourself (and your website) on the user-agent
40
+ #USER_AGENT = "gaode (+http://www.yourdomain.com)"
41
+
42
+ # Obey robots.txt rules
43
+ ROBOTSTXT_OBEY = False
44
+
45
+ # Configure maximum concurrent requests performed by Scrapy (default: 16)
46
+ #CONCURRENT_REQUESTS = 32
47
+
48
+ # Configure a delay for requests for the same website (default: 0)
49
+ # See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay
50
+ # See also autothrottle settings and docs
51
+ #DOWNLOAD_DELAY = 3
52
+ # The download delay setting will honor only one of:
53
+ #CONCURRENT_REQUESTS_PER_DOMAIN = 16
54
+ #CONCURRENT_REQUESTS_PER_IP = 16
55
+
56
+ # Disable cookies (enabled by default)
57
+ #COOKIES_ENABLED = False
58
+
59
+ # Disable Telnet Console (enabled by default)
60
+ #TELNETCONSOLE_ENABLED = False
61
+
62
+ # Override the default request headers:
63
+ #DEFAULT_REQUEST_HEADERS = {
64
+ # "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
65
+ # "Accept-Language": "en",
66
+ #}
67
+
68
+ # Enable or disable spider middlewares
69
+ # See https://docs.scrapy.org/en/latest/topics/spider-middleware.html
70
+ #SPIDER_MIDDLEWARES = {
71
+ # "gaode.middlewares.GaodeSpiderMiddleware": 543,
72
+ #}
73
+
74
+ # Enable or disable downloader middlewares
75
+ # See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
76
+ DOWNLOADER_MIDDLEWARES = {
77
+ "gaode.middlewares.MyRandomUserAgentMiddleware": 543,
78
+ }
79
+
80
+ # Enable or disable extensions
81
+ # See https://docs.scrapy.org/en/latest/topics/extensions.html
82
+ #EXTENSIONS = {
83
+ # "scrapy.extensions.telnet.TelnetConsole": None,
84
+ #}
85
+
86
+ # Configure item pipelines
87
+ # See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
88
+ #ITEM_PIPELINES = {
89
+ # "gaode.pipelines.GaodePipeline": 300,
90
+ #}
91
+
92
+ # Enable and configure the AutoThrottle extension (disabled by default)
93
+ # See https://docs.scrapy.org/en/latest/topics/autothrottle.html
94
+ #AUTOTHROTTLE_ENABLED = True
95
+ # The initial download delay
96
+ #AUTOTHROTTLE_START_DELAY = 5
97
+ # The maximum download delay to be set in case of high latencies
98
+ #AUTOTHROTTLE_MAX_DELAY = 60
99
+ # The average number of requests Scrapy should be sending in parallel to
100
+ # each remote server
101
+ #AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
102
+ # Enable showing throttling stats for every response received:
103
+ #AUTOTHROTTLE_DEBUG = False
104
+
105
+ # Enable and configure HTTP caching (disabled by default)
106
+ # See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
107
+ #HTTPCACHE_ENABLED = True
108
+ #HTTPCACHE_EXPIRATION_SECS = 0
109
+ #HTTPCACHE_DIR = "httpcache"
110
+ #HTTPCACHE_IGNORE_HTTP_CODES = []
111
+ #HTTPCACHE_STORAGE = "scrapy.extensions.httpcache.FilesystemCacheStorage"
112
+
113
+ # Set settings whose default value is deprecated to a future-proof value
114
+ REQUEST_FINGERPRINTER_IMPLEMENTATION = "2.7"
115
+ TWISTED_REACTOR = "twisted.internet.asyncioreactor.AsyncioSelectorReactor"
116
+ FEED_EXPORT_ENCODING = "utf-8"
scrapy/gaode/gaode/spiders/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # This package will contain the spiders of your Scrapy project
2
+ #
3
+ # Please refer to the documentation for information on how to create and manage
4
+ # your spiders.
scrapy/gaode/gaode/spiders/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (204 Bytes). View file
 
scrapy/gaode/gaode/spiders/__pycache__/bit.cpython-311.pyc ADDED
Binary file (1.15 kB). View file
 
scrapy/gaode/gaode/spiders/bit.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import scrapy
2
+
3
+
4
+ class BitSpider(scrapy.Spider):
5
+ name = "bit"
6
+ allowed_domains = ["amap.com"]
7
+ start_urls = ["https://www.amap.com/search?query=北京理工大学&city=100000&geoobj=112.063%7C37.029506%7C122.079296%7C41.867776&zoom=6.97"]
8
+
9
+ def parse(self, response):
10
+ with open("./gaode.html", 'w') as f:
11
+ f.write(response.text)
scrapy/gaode/scrapy.cfg ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Automatically created by: scrapy startproject
2
+ #
3
+ # For more information about the [deploy] section see:
4
+ # https://scrapyd.readthedocs.io/en/latest/deploy.html
5
+
6
+ [settings]
7
+ default = gaode.settings
8
+
9
+ [deploy]
10
+ #url = http://localhost:6800/
11
+ project = gaode
scrapy/scrapy01/data/game.txt ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 三国很忙: 策略类: 2023-10-26
2
+ 寻找盛装的男孩: 益智类: 2023-10-26
3
+ 指尖投篮: 敏捷篇: 2023-10-26
4
+ 地下隧道大逃脱: 益智类: 2023-10-26
5
+ 南瓜噩梦: 敏捷篇: 2023-10-26
6
+ 救援埃莉诺: 益智类: 2023-10-26
7
+ 甲板清洁工: 益智类: 2023-10-26
8
+ 方块世界大爆破3: 益智类: 2023-10-26
9
+ 营救皇家动物: 益智类: 2023-10-26
10
+ 小恐龙逃离: 益智类: 2023-10-26
11
+ 救援工作人员: 益智类: 2023-10-26
12
+ 方块球球: 益智类: 2023-10-26
13
+ 拼接英语单词: 益智类: 2023-10-26
14
+ 逃离工地: 益智类: 2023-10-26
15
+ 新生的奥秘: 益智类: 2023-10-26
16
+ 救助受困的鱼: 射击类: 2023-10-26
17
+ 摆动蜘蛛过障碍: 敏捷篇: 2023-10-26
18
+ 水疗中心的服务: 益智类: 2023-10-26
19
+ 露西四季时尚达人: 装扮类: 2023-10-26
20
+ 下水道逃脱: 益智类: 2023-10-26
21
+ 从前时光: 益智类: 2023-10-26
22
+ 幽灵酒馆: 益智类: 2023-10-26
23
+ 美丽蝴蝶大逃脱: 益智类: 2023-10-26
24
+ NBA英雄: 体育类: 2023-10-25
25
+ 救援小海豚: 益智类: 2023-10-25
26
+ 盒子的秘密: 益智类: 2023-10-25
27
+ 拯救笼中白母鸡: 益智类: 2023-10-25
28
+ 天空探险队: 益智类: 2023-10-25
29
+ 可爱小马逃脱: 益智类: 2023-10-25
30
+ 圆球华容道: 益智类: 2023-10-25
31
+ 逃离景区河流: 益智类: 2023-10-25
32
+ 火柴人出逃记: 益智类: 2023-10-25
33
+ 给客人做饭H5: 休闲类: 2023-10-25
34
+ 拯救笼中小猪: 益智类: 2023-10-25
35
+ 红方块闯迷宫: 益智类: 2023-10-25
36
+ 保护我的南瓜: 益智类: 2023-10-25
37
+ 救援名人夫妇: 益智类: 2023-10-25
38
+ 小黑花花射飞镖H5: 益智类: 2023-10-25
39
+ 拯救狞猫: 益智类: 2023-10-25
40
+ 寻找心理医生: 益智类: 2023-10-25
41
+ 寻找汽车钥匙: 益智类: 2023-10-25
42
+ 绵羊过障碍: 敏捷篇: 2023-10-25
43
+ 逗小猴开心系列812: 益智类: 2023-10-25
44
+ 音乐笔记: 益智类: 2023-10-25
45
+ 深渊契约: 冒险类: 2023-10-24
46
+ 海岛小分队: 休闲类: 2023-10-24
47
+ 村庄洞穴逃脱: 益智类: 2023-10-24
48
+ 逃离简易房屋129: 益智类: 2023-10-24
49
+ 夏季露营探险: 休闲类: 2023-10-24
50
+ 救援草裙姑娘: 益智类: 2023-10-24
51
+ 神秘空间站: 益智类: 2023-10-24
52
+ 前期准备工作: 益智类: 2023-10-24
53
+ 鸟群贪吃蛇: 敏捷篇: 2023-10-24
54
+ 花朵壁画屋逃脱: 益智类: 2023-10-24
55
+ 信徒: 策略类: 2023-10-24
56
+ 逃离沙漠地区: 益智类: 2023-10-24
57
+ 玫瑰仙境逃脱: 益智类: 2023-10-24
58
+ 逃离薄雾森林: 益智类: 2023-10-24
59
+ 双人激战3D: 射击类: 2023-10-24
60
+ 救出小马: 益智类: 2023-10-24
61
+ 公路赛车挑战: 敏捷篇: 2023-10-24
62
+ 宇宙猫生存: 射击类: 2023-10-24
63
+ 逃离魔法锅屋: 益智类: 2023-10-24
64
+ 拯救孔雀龙: 益智类: 2023-10-24
65
+ 红腹灰雀逃脱: 益智类: 2023-10-23
66
+ 火柴人升阶战: 益智类: 2023-10-23
67
+ 狂野大冒险: 敏捷篇: 2023-10-23
68
+ 寻找结婚礼服: 益智类: 2023-10-23
69
+ 一笔画出来: 益智类: 2023-10-23
70
+ 救援暹罗猫: 益智类: 2023-10-23
71
+ 奇妙的化妆术: 装扮类: 2023-10-23
72
+ 逗小猴开心系列811: 益智类: 2023-10-23
73
+ 纸杯蛋糕的线索: 益智类: 2023-10-23
74
+ 目的地之谜: 益智类: 2023-10-23
75
+ 找到海港走私者: 益智类: 2023-10-23
76
+ 暴打小僵尸: 射击类: 2023-10-23
77
+ 山鹿逃出山谷: 益智类: 2023-10-23
78
+ 维京人逃生记2: 冒险类: 2023-10-23
79
+ 隧道冲击: 敏捷篇: 2023-10-23
80
+ 昏暗儿童房逃生130: 益智类: 2023-10-22
81
+ 沉没的宝藏2: 益智类: 2023-10-22
82
+ 古墓诡影: 益智类: 2023-10-22
83
+ 迷路的猫: 益智类: 2023-10-22
84
+ 管道冒险: 冒险类: 2023-10-22
85
+ 色彩小球转换: 敏捷篇: 2023-10-22
86
+ 荒野狩猎: 射击类: 2023-10-22
87
+ 绵羊家族逃脱: 益智类: 2023-10-22
88
+ 寻找纸袋玩具: 益智类: 2023-10-22
89
+ 新坦克对战: 策略类: 2023-10-22
90
+ 逃离破落村落: 益智类: 2023-10-22
91
+ 修车店的秘密: 益智类: 2023-10-22
92
+ 寻找丢失的黄金: 益智类: 2023-10-22
93
+ 油条冰淇淋: 休闲类: 2023-10-22
94
+ 建造天柱: 敏捷篇: 2023-10-22
95
+ 寻找铅笔男孩: 益智类: 2023-10-22
96
+ 上帝的祝福: 益智类: 2023-10-22
97
+ 红色蘑菇林逃脱: 益智类: 2023-10-22
98
+ 魔法大厨: 休闲类: 2023-10-21
99
+ 推动选取器: 敏捷篇: 2023-10-21
100
+ 疯狂克隆人: 冒险类: 2023-10-21
101
+ 爱吃苹果的男孩: 敏捷篇: 2023-10-21
102
+ 救援气球女孩: 益智类: 2023-10-21
103
+ 机器人翻翻看: 益智类: 2023-10-21
104
+ 救援美人鱼模仿者: 益智类: 2023-10-21
105
+ 汉字消方块: 益智类: 2023-10-21
106
+ 混乱的化学家: 益智类: 2023-10-21
107
+ 暗黑系公主婚礼: 装扮类: 2023-10-21
108
+ 逃离荒废的营地: 益智类: 2023-10-21
109
+ 小猪消消: 益智类: 2023-10-21
110
+ 老城区酒吧: 益智类: 2023-10-21
111
+ 封印魔法之门: 益智类: 2023-10-21
112
+ 寻找美容师: 益智类: 2023-10-21
113
+ 挪了个车: 益智类: 2023-10-21
114
+ 儿童洗衣房: 装扮类: 2023-10-21
115
+ 昏暗儿童房逃生134: 益智类: 2023-10-21
116
+ 双人PK挑战: 休闲类: 2023-10-21
117
+ 小飞象逃脱: 益智类: 2023-10-20
118
+ 寻找滑冰男孩: 益智类: 2023-10-20
119
+ 首席医生救援: 益智类: 2023-10-20
120
+ 乌鸦森林大逃脱: 益智类: 2023-10-20
121
+ 制作甜披萨的楠楠: 装扮类: 2023-10-20
122
+ 梦想海岛王: 休闲类: 2023-10-20
123
+ 剑镇三界: 冒险类: 2023-10-20
124
+ 布置我的别墅: 休闲类: 2023-10-20
125
+ 西瓜拼接: 益智类: 2023-10-20
126
+ 救援金色鸭子: 益智类: 2023-10-20
127
+ 蘑菇兄弟: 冒险类: 2023-10-20
128
+ 救援华丽的小姑娘: 益智类: 2023-10-20
129
+ 热带麻将: 益智类: 2023-10-20
130
+ 烧脑大挑战合集: 益智类: 2023-10-20
131
+ 营救男子: 益智类: 2023-10-20
132
+ 田野之间: 益智类: 2023-10-20
133
+ 闪亮少女换装: 装扮类: 2023-10-20
134
+ 救援时尚的蜘蛛侠: 益智类: 2023-10-20
135
+ 被诅咒的电影院: 益智类: 2023-10-20
136
+ 阳光大花园: 益智类: 2023-10-20
137
+ 老六别坑了: 益智类: 2023-10-20
138
+ 黑暗的窄屋逃脱: 益智类: 2023-10-20
139
+ 逃离简易房屋127: 益智类: 2023-10-20
140
+ 僵尸兄弟闯密室3: 益智类: 2023-10-20
141
+ 寻找茄子玩具: 益智类: 2023-10-19
142
+ 昏暗儿童房逃生129: 益智类: 2023-10-19
143
+ 逃离森林的爱情鸟: 益智类: 2023-10-19
144
+ 寻找公主雕像: 益智类: 2023-10-19
145
+ 英勇营救姑娘: 益智类: 2023-10-19
146
+ 逃离迷人的花园: 益智类: 2023-10-19
147
+ 快乐男孩亨利逃脱: 益智类: 2023-10-19
148
+ 自然森林大逃脱: 益智类: 2023-10-19
149
+ 逃离橄榄树园: 益智类: 2023-10-19
150
+ 棕色母鸡逃脱: 益智类: 2023-10-19
151
+ 营救学生: 益智类: 2023-10-19
152
+ 逃离顶尖音乐会: 益智类: 2023-10-19
153
+ 救援一对猫: 益智类: 2023-10-19
154
+ 救援兽人战士: 益智类: 2023-10-19
155
+ 城堡的大秘密: 益智类: 2023-10-19
156
+ 时尚女学生穿搭: 装扮类: 2023-10-19
157
+ 流浪的星球: 敏捷篇: 2023-10-19
158
+ 合并战兵2048: 敏捷篇: 2023-10-19
159
+ 鲜花城堡: 益智类: 2023-10-19
160
+ 最后一件: 益智类: 2023-10-19
161
+ 烧脑大师: 益智类: 2023-10-19
162
+ 寻找气球姑娘: 益智类: 2023-10-19
163
+ 葫芦娃各显神通: 策略类: 2023-10-18
164
+ 停车我最强: 体育类: 2023-10-18
165
+ 寻找游戏玩具: 益智类: 2023-10-18
166
+ 救援工作人员约翰: 益智类: 2023-10-18
167
+ 寻找飞马的翅膀: 益智类: 2023-10-18
168
+ 吃火锅H5: 敏捷篇: 2023-10-18
169
+ 布鲁姆吉城堡: 射击类: 2023-10-18
170
+ 狐狸逃出沙漠: 益智类: 2023-10-18
171
+ 开澡堂H5: 模拟经营: 2023-10-18
172
+ 营救笼中狮子: 益智类: 2023-10-18
173
+ 飞机极限着陆: 体育类: 2023-10-18
174
+ 部落男人逃脱: 益智类: 2023-10-18
175
+ 营救花栗鼠: 益智类: 2023-10-18
176
+ 逃离趣味冒险屋: 益智类: 2023-10-18
177
+ 寻找企鹅伙伴: 益智类: 2023-10-18
178
+ 机器人修复师: 冒险类: 2023-10-18
179
+ 寻找长生不老药水: 益智类: 2023-10-18
180
+ 救出小白兔: 益智类: 2023-10-18
181
+ 逗小猴开心系列810: 益智类: 2023-10-18
182
+ 克服心中恐惧: 益智类: 2023-10-18
183
+ 盛开的樱花树: 益智类: 2023-10-18
184
+ 逃出诡异之地: 益智类: 2023-10-17
185
+ 拯救笼中爱鸟: 益智类: 2023-10-17
186
+ 野生袋鼠救援: 益智类: 2023-10-17
187
+ 寻找喜爱的裙子: 益智类: 2023-10-17
188
+ 西部牛仔大逃脱: 益智类: 2023-10-17
189
+ 救援虎猫: 益智类: 2023-10-17
190
+ 黄鸟救援: 益智类: 2023-10-17
191
+ 抵御怪物入侵: 策略类: 2023-10-17
192
+ 寻找狮子王: 益智类: 2023-10-17
193
+ 菜鸟小忍者: 休闲类: 2023-10-17
194
+ 飞天战机: 射击类: 2023-10-17
195
+ 辛巴找水: 益智类: 2023-10-17
196
+ 双枪牛仔: 射击类: 2023-10-17
197
+ 合成射击: 射击类: 2023-10-17
198
+ 校园阴影: 益智类: 2023-10-17
199
+ 荒野生存模拟: 冒险类: 2023-10-17
200
+ 初秋时尚穿搭: 装扮类: 2023-10-17
201
+ 面具进化: 敏捷篇: 2023-10-17
202
+ 姑娘的约会夜: 装扮类: 2023-10-17
203
+ 蚂蚁逃离: 益智类: 2023-10-17
204
+ 小黑花花糖果砸巫婆H5: 射击类: 2023-10-16
205
+ 逗小猴开心系列809: 益智类: 2023-10-16
206
+ 回响的街道: 益智类: 2023-10-16
207
+ 快速改道: 益智类: 2023-10-16
scrapy/scrapy01/scrapy.cfg ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Automatically created by: scrapy startproject
2
+ #
3
+ # For more information about the [deploy] section see:
4
+ # https://scrapyd.readthedocs.io/en/latest/deploy.html
5
+
6
+ [settings]
7
+ default = scrapy01.settings
8
+
9
+ [deploy]
10
+ #url = http://localhost:6800/
11
+ project = scrapy01
scrapy/scrapy01/scrapy01/__init__.py ADDED
File without changes
scrapy/scrapy01/scrapy01/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (184 Bytes). View file
 
scrapy/scrapy01/scrapy01/__pycache__/items.cpython-39.pyc ADDED
Binary file (426 Bytes). View file
 
scrapy/scrapy01/scrapy01/__pycache__/pipelines.cpython-39.pyc ADDED
Binary file (1.1 kB). View file