is_numeric fixed
This commit is contained in:
parent
af41201b4f
commit
78d0a8ebca
@ -253,9 +253,12 @@ class LinkedInEasyApplier:
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _is_numeric_field(self, element: WebElement) -> bool:
|
def _is_numeric_field(self, field: WebElement) -> bool:
|
||||||
input_type = element.get_attribute('type')
|
field_type = field.get_attribute('type').lower()
|
||||||
return input_type == 'number'
|
if 'numeric' in field_type:
|
||||||
|
return True
|
||||||
|
class_attribute = field.get_attribute("id")
|
||||||
|
return class_attribute and 'numeric' in class_attribute
|
||||||
|
|
||||||
def _enter_text(self, element: WebElement, text: str) -> None:
|
def _enter_text(self, element: WebElement, text: str) -> None:
|
||||||
element.clear()
|
element.clear()
|
||||||
|
@ -114,7 +114,6 @@ class LinkedInJobManager:
|
|||||||
page_sleep += 1
|
page_sleep += 1
|
||||||
|
|
||||||
def apply_jobs(self):
|
def apply_jobs(self):
|
||||||
try:
|
|
||||||
try:
|
try:
|
||||||
no_jobs_element = self.driver.find_element(By.CLASS_NAME, 'jobs-search-two-pane__no-results-banner--expand')
|
no_jobs_element = self.driver.find_element(By.CLASS_NAME, 'jobs-search-two-pane__no-results-banner--expand')
|
||||||
if 'No matching jobs found' in no_jobs_element.text or 'unfortunately, things aren' in self.driver.page_source.lower():
|
if 'No matching jobs found' in no_jobs_element.text or 'unfortunately, things aren' in self.driver.page_source.lower():
|
||||||
@ -143,9 +142,7 @@ class LinkedInJobManager:
|
|||||||
self.write_to_file(job, "failed")
|
self.write_to_file(job, "failed")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
traceback.format_exc()
|
|
||||||
raise e
|
|
||||||
|
|
||||||
def write_to_file(self, job, file_name):
|
def write_to_file(self, job, file_name):
|
||||||
data = {
|
data = {
|
||||||
@ -156,6 +153,7 @@ class LinkedInJobManager:
|
|||||||
"pdf_path": job.pdf_path
|
"pdf_path": job.pdf_path
|
||||||
}
|
}
|
||||||
file_path = self.output_file_directory / f"{file_name}.json"
|
file_path = self.output_file_directory / f"{file_name}.json"
|
||||||
|
file_path = file_path.as_posix()
|
||||||
if not file_path.exists():
|
if not file_path.exists():
|
||||||
with open(file_path, 'w', encoding='utf-8') as f:
|
with open(file_path, 'w', encoding='utf-8') as f:
|
||||||
json.dump([data], f, indent=4)
|
json.dump([data], f, indent=4)
|
||||||
|
Loading…
Reference in New Issue
Block a user