摘要:
import asyncio import aiohttp import time def test(number): start = time.time() async def get(url): session = aiohttp.ClientSession(connector=aiohttp. 阅读全文
摘要:
import time import sys for i in range(100): sys.stdout.write(str(i)+'>') time.sleep(1) sys.stdout.flush() 输出效果 python3 a.py 0>1>2>3>4>5>6>7>8>9>10>11> 阅读全文
摘要:
刚买的云服务器中文乱码, locale -a locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No s 阅读全文
摘要:
selenium爬取网站数据 调用Chrome浏览器 from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by im 阅读全文
摘要:
tcpdump输入简记: tcpdump -i eth0 host 1.1.1.1 and dst port 28080 and src 2.2.2.2 通过以上可以初步说明2.2.2.2的服务器有没有向1.1.1.1服务器发送数据。 tcpdump输出简介: 20:34:28.943272 IP 阅读全文
摘要:
from selenium import webdriver from selenium.webdriver import ChromeOptions option = ChromeOptions() option.add_argument('--headless') browser = webdr 阅读全文
摘要:
from typing_extensions import Final from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys imp 阅读全文
摘要:
import json from os import makedirs from os.path import exists RESULTS_DIR = 'results' exists(RESULTS_DIR) or makedirs(RESULTS_DIR) def save_data(data 阅读全文
摘要:
import requests Cookie = 'xxxxx' UserAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515. 阅读全文
摘要:
供参考 from multiprocessing import Pool import time def function(index): print(f'Start process: {index}') time.sleep(3) print(f'End process {index}') if 阅读全文