Advertisement
dereksir

Untitled

Feb 1st, 2024
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. from playwright.async_api import async_playwright
  2. import asyncio
  3.  
  4. async def main():
  5.     async with async_playwright() as playwright:
  6.         browser = await playwright.chromium.launch(
  7.              proxy={
  8.                'server': "181.129.43.3:8080",
  9.                },
  10.         )
  11.         context = await browser.new_context()
  12.         page = await context.new_page()
  13.  
  14.         await page.goto("https://httpbin.org/ip")
  15.         html_content = await page.content()
  16.         print(html_content)
  17.  
  18.         await context.close()
  19.         await browser.close()
  20.  
  21. asyncio.run(main())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement