ngrok: start gist and get proxy ip in a single function

master
EmaMaker 2021-08-25 18:20:16 +02:00
parent bd7a74d08c
commit 30a4e89c27
2 changed files with 14 additions and 1 deletions

View File

@ -6,13 +6,26 @@
from utils import browser_manager
from selenium.webdriver.common.by import By
import time
from colab import colab
def start_proxy_get_ip():
c = colab.ColabGist('https://colab.research.google.com/gist/EmaMaker/4e1478c9913a2df58fc1b8ff422fa161/proxy.ipynb', ('giangillo.rossi@gmail.com', 'emamaker02'), minutes=3)
c.run()
time.sleep(120)
n = Ngrok()
n.start_browser()
n.access_ngrok()
return n.get_proxy_ip()
class Ngrok:
def __init__(self):
pass
def start_browser(self):
self.driver = browser_manager.start_browser()
self.driver = browser_manager.start_browser(headless=True)
def close_browser(self):
browser_manager.quit_browser(self.driver)