From e000a7cb3550efae6134c1a5224d0a3ae039caaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E4=BC=A6=E4=BC=A6?= Date: Tue, 30 Nov 2021 17:16:33 +0800 Subject: [PATCH] python main.py url --- main.py | 4 +++- scripts/webdriver.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index ee935f9..dc42b36 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,9 @@ +import sys + from scripts import watcher, webdriver if __name__ == '__main__': - webdriver.lunch() + webdriver.lunch(sys.argv[1]) w = watcher.Watcher(directory='/Users/geng/douyin_live') w.run() diff --git a/scripts/webdriver.py b/scripts/webdriver.py index fcdb204..82ff276 100644 --- a/scripts/webdriver.py +++ b/scripts/webdriver.py @@ -1,7 +1,7 @@ from selenium import webdriver from selenium.webdriver.chrome.options import Options -def lunch(): +def lunch(url): chrome_options = Options() chrome_options.add_argument('--proxy-server=127.0.0.1:8080') chrome_options.add_argument('--headless') @@ -9,5 +9,5 @@ def lunch(): driver = webdriver.Chrome(options=chrome_options) - driver.get('https://live.douyin.com/515848215303') + driver.get(url)