这是一个使用pyppeteer的Python上的web scraper 代码部分:
async def process(query):
print('START PROCESS')
async with aiofiles.open(os.path.join(BASEDIR, config['PARSER']['Proxies']), mode='r', encoding="utf-8") as f:
proxies = await f.readlines()
await f.close()
proxies = [x.strip() for x in proxies if x != '']
proxy = random.choice(proxies)
print('TEST')
browser = await launch(headless=False, args=['--no-sandbox', '--proxy-server='+proxy, ])
print(4)
#Some code
异步使用pyppeteer运行一些chrome进程。它在Linux(Debian)上工作得很好,但在Windows上根本不工作。浏览器启动,但即使打印(4)也不运行。启动浏览器后代码冻结,不会出现任何错误。我能用它做什么
目前没有回答
相关问题 更多 >
编程相关推荐