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 8ae58fc commit 9c5c31d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions twitter_user_tweet_crawler/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ def _on_job_complete(self, index, future):
future.result()
except NoSuchElementException:
pass
except WebDriverException as e:
logger.error(e)
# By default, `concurrent.futures` will silently log errors but will not raise them
# Throw the error directly
self.browser[elements].__dict__['is_using'] = False
Expand Down
6 changes: 5 additions & 1 deletion twitter_user_tweet_crawler/tweet.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ def click_sensitive_element():
result = None
available_driver.get(self.link)
wait = WebDriverWait(available_driver, 20)
element = wait.until(EC.presence_of_element_located((By.XPATH, '//*/time/ancestor::*[3]')))
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
try:
Expand Down

0 comments on commit 9c5c31d

Please sign in to comment.