Get the href within the tags rather than click them.

This commit is contained in:
2025-03-06 15:02:04 -08:00
parent 76669872ae
commit 3a619ee08f

View File

@@ -41,7 +41,8 @@ def dumb_make_tags(queues,tags,driver):
for tag in tags:
if found_string(queues, tag.text.lower()) == False:
driver.execute_script("arguments[0].scrollIntoView(true);", tag)
ac.context_click(tag).perform()
tag_href = tag.find_element(By.TAG_NAME, "a").get_attribute("href")
driver.execute_script("window.open(arguments[0]);", tag_href)
WebDriverWait(driver, 10).until(EC.number_of_windows_to_be(2))
for window_handle in driver.window_handles:
if window_handle != original_window:
@@ -81,7 +82,8 @@ def guided_make_tags(queues,tags,driver):
for tag in tags:
if found_string(queues, tag.text.lower()) == False:
driver.execute_script("arguments[0].scrollIntoView(true);", tag)
ac.context_click(tag).perform()
tag_href = tag.find_element(By.TAG_NAME, "a").get_attribute("href")
driver.execute_script("window.open(arguments[0]);", tag_href)
WebDriverWait(driver, 10).until(EC.number_of_windows_to_be(2))
for window_handle in driver.window_handles:
if window_handle != original_window:
@@ -127,7 +129,8 @@ def smart_make_tags(queues,tags,driver):
if found_string(queues, tag.text.lower()) == False:
lowest_queue = find_lowest_and_increment(tag_count)
driver.execute_script("arguments[0].scrollIntoView(true);", tag)
ac.context_click(tag).perform()
tag_href = tag.find_element(By.TAG_NAME, "a").get_attribute("href")
driver.execute_script("window.open(arguments[0]);", tag_href)
WebDriverWait(driver, 10).until(EC.number_of_windows_to_be(2))
for window_handle in driver.window_handles:
if window_handle != original_window: