问题
I want to run chromium browser using auth proxy. I have this code, but chromium does not connect via the proxy. Any suggestions please?
import asyncio
from pyppeteer import launch
async def main():
browser = await launch({'http_proxy': 'ip:port', 'headless': False })
page = await browser.newPage()
await page.goto('https://www.myip.com/')
await page.authenticate({'username': 'user', 'password': 'passw'})
input()
await browser.close()
asyncio.get_event_loop().run_until_complete(main())
EDIT: Got the proxy working, EXCEPT the authentication.
import asyncio
from pyppeteer import launch
async def main():
browser = await launch({'args': ['--proxy-server=ip:port'], 'headless': False })
page = await browser.newPage()
await page.goto('https://www.myip.com/')
await page.authenticate({'username': 'user', 'password': 'passw'})
input()
await browser.close()
asyncio.get_event_loop().run_until_complete(main())
来源:https://stackoverflow.com/questions/59270710/python-pyppeteer-proxy-usage