Skip to content

Commit

Permalink
fuck u twitter
Browse files Browse the repository at this point in the history
  • Loading branch information
kaixinol committed Nov 12, 2023
1 parent 9c5c31d commit a2d657d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/CI.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def get_browser() -> WebDriver:
class TestCase(unittest.TestCase):
def test_spider(self):
broswer = get_browser()
tweet = Tweet('https://twitter.com/jack/status/20', is_ci_test=True)
tweet = Tweet('https://twitter.com/_CASTSTATION/status/1697029186777706544', is_ci_test=True)
tweet.load_data(broswer)
self.assertEqual(tweet.text, 'just setting up my twttr') # add assertion here
self.assertEqual(tweet.text, 'miku miku oo ee oo') # add assertion here


if __name__ == '__main__':
Expand Down
4 changes: 0 additions & 4 deletions twitter_user_tweet_crawler/tweet.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ def click_sensitive_element():
result = None
available_driver.get(self.link)
wait = WebDriverWait(available_driver, 20)
try:
time_stamp = available_driver.find_element(By.XPATH, '//time').get_attribute('datetime')
except:
print('老大 我是真的没time标签')
element = wait.until(EC.presence_of_element_located((By.XPATH, '//*/time/ancestor::*[5]')))
time_stamp = available_driver.find_element(By.XPATH, '//time').get_attribute('datetime')
location = True
Expand Down

0 comments on commit a2d657d

Please sign in to comment.