From 846d44206eb8ccd25330b0729fd46f3d44543847 Mon Sep 17 00:00:00 2001 From: wufayuan <2858767122@qq.com> Date: Sun, 3 Jul 2022 17:19:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=83=E4=B8=BA=E5=AE=8C=E6=95=B4=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dcs/client/client.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dcs/client/client.py b/dcs/client/client.py index 0d2cc6e..e79f7ab 100644 --- a/dcs/client/client.py +++ b/dcs/client/client.py @@ -17,7 +17,7 @@ from dcs.tools.message_process import parse_request, generate_response def crawl_zhiwang(word, pages_start, pages_end): edge_options = EdgeOptions() edge_options.use_chromium = True - # edge_options.add_argument('--headless') + edge_options.add_argument('--headless') driver = Edge(options=edge_options, executable_path=r'G:\course\yykf\dcs\bin\msedgedriver.exe') soup = driver_open(driver, word) @@ -42,7 +42,7 @@ def crawl_zhiwang(word, pages_start, pages_end): paper_id += 1 pages_start += 1 driver.close() - logger.debug("here") + # logger.debug("here") return res @@ -112,13 +112,13 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) as so "utf-8")) print(responseJson) - request = {'action': 'crawl zhiwang', 'word': 'science', 'pages_start': 1, 'pages_end': 3, - 'cookie': cookie} - socket_to_server.sendall(mp.generate_request(request)) - responseJson = JSONDecoder().decode( - mp.read_bytes(socket_to_server, struct.unpack('!Q', socket_to_server.recv(8))[0]).decode( - "utf-8")) - print(responseJson) + # request = {'action': 'crawl zhiwang', 'word': 'science', 'pages_start': 1, 'pages_end': 3, + # 'cookie': cookie} + # socket_to_server.sendall(mp.generate_request(request)) + # responseJson = JSONDecoder().decode( + # mp.read_bytes(socket_to_server, struct.unpack('!Q', socket_to_server.recv(8))[0]).decode( + # "utf-8")) + # print(responseJson) request = {'action': 'end'} socket_to_server.sendall(mp.generate_request(request))