| 3 | |
| 4 | |
| 5 | async def main(): |
| 6 | client = Client( |
| 7 | impersonate=Impersonate.Firefox133, |
| 8 | user_agent="rnet", |
| 9 | proxies=[ |
| 10 | Proxy.http("socks5h://abc:def@127.0.0.1:6152"), |
| 11 | Proxy.https(url="socks5h://127.0.0.1:6153", username="abc", password="def"), |
| 12 | Proxy.http( |
| 13 | url="http://abc:def@127.0.0.1:6152", |
| 14 | custom_http_auth="abcedf", |
| 15 | custom_http_headers={"User-Agent": "rnet", "x-custom-header": "value"}, |
| 16 | ), |
| 17 | Proxy.all( |
| 18 | url="socks5h://abc:def@127.0.0.1:6153", |
| 19 | exclusion="google.com, facebook.com, twitter.com", |
| 20 | ), |
| 21 | ], |
| 22 | ) |
| 23 | |
| 24 | resp = await client.get("https://money-tourism.gr/en") |
| 25 | print("Status Code: ", resp.status_code) |
| 26 | print("Version: ", resp.version) |
| 27 | print("Response URL: ", resp.url) |
| 28 | print("Headers: ", resp.headers) |
| 29 | print("Content-Length: ", resp.content_length) |
| 30 | print("Encoding: ", resp.encoding) |
| 31 | print("Remote Address: ", resp.remote_addr) |
| 32 | text = await resp.text() |
| 33 | print("Text: ", text) |
| 34 | |
| 35 | |
| 36 | if __name__ == "__main__": |