2023年8月3日
摘要: 在子线程内直接获取事件循环会报错:RuntimeError: There is no current event loop in thread 'Thread-2',此时的代码为: loop = asyncio.get_event_loop()loop.run_until_complete(协程函数 阅读全文
posted @ 2023-08-03 17:52 CJTARRR 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 安装 pip install r-useragent 使用 from random_useragent import UserAgent​u = UserAgent()​# generate android user-agentprint(u.android()) # randomprint(u.a 阅读全文
posted @ 2023-08-03 17:43 CJTARRR 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 当在子线程中调用pyppeteer工具的时候,会报错:ValueError: signal only works in main thread。 解决方案: 在创建浏览器对象时,加上以下三个字段: 阅读全文
posted @ 2023-08-03 17:33 CJTARRR 阅读(321) 评论(0) 推荐(0) 编辑