From 8a9c3e0b760e8c5bfe53e5c01fda43f3ba22e79c Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Wed, 26 Jun 2024 15:35:36 -0400 Subject: [PATCH] added test for visited date starting with string --- social.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/social.py b/social.py index 3ef55e1..e6cd77a 100644 --- a/social.py +++ b/social.py @@ -448,8 +448,11 @@ def get_google_data(driver, local_outputs): visitdate = data.find_element(By.CSS_SELECTOR, 'span.rsqaWe').text except NoSuchElementException : visitdate = "Unknown" - print(' Visited: ',visitdate) - newdate,newdate2,visitdate = get_wordpress_post_date_string(visitdate, datetime.now()) + print(' Visited: ',visitdate, visitdate[:1]) + if re.match('^[a-zA-Z]+', visitdate) is None: + #if visitdate[:1].isalpha: + newdate,newdate2,visitdate = get_wordpress_post_date_string(str(visitdate), str(datetime.now())) + print(' Visited altered to : ',visitdate) try: text = data.find_element(By.CSS_SELECTOR, 'div.MyEned').text except NoSuchElementException :