Skip to content

Commit

Permalink
👷 Update chromedriver acquisition method
Browse files Browse the repository at this point in the history
  • Loading branch information
kaixinol committed Nov 20, 2023
1 parent 7e00e86 commit 0a3e288
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/CI.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import os
import unittest
from time import sleep

from selenium import webdriver
from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.webdriver.common.by import By

from twitter_user_tweet_crawler.util.config import config

print(os.getcwd())
config.load({"proxy": {"http": "socks5://127.0.0.1:7890", "https": "socks5://127.0.0.1:7890"}, "max_threads": 2,
"header": {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, "
"like Gecko) "}
, "inject_js": "/media/Data/Project/twitter_user_tweet_crawler/script.js",
"save": "/media/Data/Project/twitter_user_tweet_crawler/output/", }
)
from twitter_user_tweet_crawler.tweet import Tweet


Expand All @@ -24,9 +33,9 @@ def test_spider(self):
browser = get_browser()
browser.get('https://twitter.com/_CASTSTATION/status/1697029186777706544')
sleep(20)
element = browser.find_element(By.XPATH,"//*[contains(text(), '{}')]".format('miku miku oo ee oo'))
element = browser.find_element(By.XPATH, "//*[contains(text(), '{}')]".format('miku miku oo ee oo'))
browser.save_screenshot('debug.png')
self.assertIn('miku miku oo ee oo',element.get_attribute('innerHTML'))
self.assertIn('miku miku oo ee oo', element.get_attribute('innerHTML'))


if __name__ == '__main__':
Expand Down

0 comments on commit 0a3e288

Please sign in to comment.