I linked two pictures below. Looking within both a tag, I want to extract only the 'quick apply' job postings which are defined with the target='self' compared to the external apply which is defined by target='_blank'. I want to put a conditional to exlcude all the _blank profiles. I'm confused but I assume it would follow some logic like:
quick_apply = driver.find_element(By.XPATH, "//a[@data-automation='job-detail-apply']")
internal = driver.find_element(By.XPATH, "//a[@target='_self']")
if internal in quick_apply:
quick_apply.click()
else:
pass
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.service import Service
driver_service = Service(executable_path="C:\Program Files (x86)\chromedriver.exe")
driver = webdriver.Chrome(service=driver_service)
driver.maximize_window() # load web driver
wait = WebDriverWait(driver, 5)
driver.get('https://www.seek.com.au/data-jobs-in-information-communication-technology/in-All-Perth-WA')
looking_job = [x.get_attribute('href') for x in driver.find_elements(By.XPATH, "//a[@data-automation='jobTitle']")]
for job in looking_job:
driver.get(job)
quick_apply = driver.find_element(By.XPATH, "//a[@data-automation='job-detail-apply']").click()

