Skip to content

Commit

Permalink
Updated updating text boxes for additional questions. And added quest…
Browse files Browse the repository at this point in the history
…ion for languages spoken for English.
  • Loading branch information
MrCredible committed Jul 22, 2020
1 parent 984c971 commit 5dcaa83
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions easyapplybot.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def browser_options(self):
options.add_argument("--ignore-certificate-errors")
options.add_argument('--no-sandbox')
options.add_argument("--disable-extensions")

#Disable webdriver flags or you will be easily detectable
options.add_argument("--disable-blink-features")
options.add_argument("--disable-blink-features=AutomationControlled")
return options

def start_linkedin(self,username,password):
Expand Down Expand Up @@ -310,7 +314,7 @@ def is_present(button_locator):
testLabel_locator = (By.XPATH, "//span[@data-test-form-element-label-title='true']")
yes_locator = (By.XPATH, "//input[@value='Yes']")
no_locator = (By.XPATH, "//input[@value='No']")
textInput_locator = (By.XPATH, "//div[@data-test-single-line-text-input-wrap='true']")
textInput_locator = (By.XPATH, "//input[@type='text']")


submitted = False
Expand Down Expand Up @@ -393,6 +397,23 @@ def is_present(button_locator):
textField.send_keys("10")
log.info("Sent keys to the text field %s", textInput_locator)

#This should be updated to match the language you speak.
if "Do you" in text and "speak" in text:
if "English" in text:
yesRadio = testLabelElement.find_element(By.XPATH, yes_locator[1])
time.sleep(1)
log.info("Attempting to click the radio button for %s", yes_locator)
self.browser.execute_script("arguments[0].click()", yesRadio)
log.info("Clicked the radio button %s", yes_locator)
#if not english then say no.
else:
noRadio = testLabelElement.find_element(By.XPATH, no_locator[1])
time.sleep(1)
log.info("Attempting to click the radio button for %s", no_locator)
self.browser.execute_script("arguments[0].click()", noRadio)
log.info("Clicked the radio button %s", no_locator)



except Exception as e:
log.exception("Could not answer additional questions: %s", e)
Expand Down Expand Up @@ -531,7 +552,9 @@ def setupLogger():
if output_filename == [None]:
output_filename = "./output.csv"
if not os.path.exists(output_filename):
with open(output_filename, 'w+'): pass
with open(output_filename, 'w+') as f:
writer = csv.writer(f)
writer.writerow(['DateTime', 'JobID', 'Title', 'Company', 'Attempted', 'Success'])

bot = EasyApplyBot(parameters['username'],
parameters['password'],
Expand Down

0 comments on commit 5dcaa83

Please sign in to comment.