Skip to content

Commit

Permalink
fuck u twitter
Browse files Browse the repository at this point in the history
kaixinol committed Nov 12, 2023
1 parent a2d657d commit 4632e03
Showing 2 changed files with 20 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/python-app.yaml
Original file line number Diff line number Diff line change
@@ -44,4 +44,18 @@ jobs:
- name: Test with unittest
run: |
python -m poetry run python -m unittest tests.CI
echo
- name: Check if debug.png exists
run: |
if [ -f debug.png ]; then
echo "Debug.png file exists"
echo "::set-output name=debug_exists::true"
else
echo "Debug.png file does not exist"
echo "::set-output name=debug_exists::false"
fi
- name: Upload artifact
if: steps.check_debug.outputs.debug_exists == 'true'
uses: actions/upload-artifact@v2
with:
name: debug-artifact
path: debug.png
6 changes: 5 additions & 1 deletion twitter_user_tweet_crawler/tweet.py
Original file line number Diff line number Diff line change
@@ -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::*[5]')))
element = None
try:
element = wait.until(EC.presence_of_element_located((By.XPATH, '//*/time/ancestor::*[5]')))
except:
available_driver.save_screenshot('debug.png')
time_stamp = available_driver.find_element(By.XPATH, '//time').get_attribute('datetime')
location = True
try:

0 comments on commit 4632e03

Please sign in to comment.