From 5af6fd1f3167289e35b6f123bb08103d41539961 Mon Sep 17 00:00:00 2001 From: kaesinol Date: Sun, 12 Nov 2023 23:52:51 +0800 Subject: [PATCH] fuck u github ci --- tests/CI.py | 8 ++------ twitter_user_tweet_crawler/pool.py | 1 - twitter_user_tweet_crawler/tweet.py | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/CI.py b/tests/CI.py index 2a357b2..26fbf51 100644 --- a/tests/CI.py +++ b/tests/CI.py @@ -14,8 +14,6 @@ def get_browser() -> WebDriver: chrome_options.add_argument('--disable-gpu') chrome_options.add_argument('--no-sandbox') chrome_options.add_argument('--headless') - chrome_options.add_argument('--disable-dev-shm-usage') - chrome_options.add_argument('--remote-debugging-pipe') driver = webdriver.Chrome(options=chrome_options) return driver @@ -25,11 +23,9 @@ def test_spider(self): broswer = get_browser() tweet = Tweet('https://twitter.com/_CASTSTATION/status/1697029186777706544', is_ci_test=True) tweet.load_data(broswer) - broswer.get('https://twitter.com/_CASTSTATION/status/1697029186777706544') - broswer.implicitly_wait(60) + print(tweet.text) + sleep(20) broswer.save_screenshot('debug.png') - print('fuck u twitter') - print(Path('debug.png').absolute()) self.assertEqual(True,True) # add assertion here diff --git a/twitter_user_tweet_crawler/pool.py b/twitter_user_tweet_crawler/pool.py index c3ccd51..6aa2625 100644 --- a/twitter_user_tweet_crawler/pool.py +++ b/twitter_user_tweet_crawler/pool.py @@ -38,6 +38,5 @@ def _on_job_complete(self, index, future): pass # By default, `concurrent.futures` will silently log errors but will not raise them # Throw the error directly - self.browser[elements].__dict__['is_using'] = False self.check_and_work() diff --git a/twitter_user_tweet_crawler/tweet.py b/twitter_user_tweet_crawler/tweet.py index aebe59d..a66de88 100644 --- a/twitter_user_tweet_crawler/tweet.py +++ b/twitter_user_tweet_crawler/tweet.py @@ -83,11 +83,9 @@ def click_sensitive_element(): ActionChains(available_driver).move_to_element(i).click().perform() except: pass - available_driver.implicitly_wait(0.5) - + sleep(0.5) result = None available_driver.get(self.link) - available_driver.implicitly_wait(20) wait = WebDriverWait(available_driver, 20) element = wait.until(EC.presence_of_element_located((By.XPATH, '//*/time/ancestor::*[3]'))) time_stamp = element.find_element(By.XPATH, '//time').get_attribute('datetime')