> For the complete documentation index, see [llms.txt](https://codingmace.gitbook.io/masterward/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codingmace.gitbook.io/masterward/software/work-in-progress/appfiller.md).

# AppFiller

## Origin

The idea was that I hate filing out job applications, so why not just automate it.&#x20;

## Overview

The application has 2-parts the spidering and applying. The spidering gets all the jobs based on a query compared to the applying that requires a login and applies to the jobs that were was found during spidering.

## Step 1: Setup

Key aspect since the program is based on Selenium is the driver for the application. I decided to use Edge because majority of people are using windows and it is built in. In the future making it available for other web platforms is ideal.

```python
def setup():
	options = webdriver.EdgeOptions()
	options.add_argument("--ignore-certificate-error")
	options.add_argument("--ignore-ssl-errors")
	options.add_argument('--ignore-certificate-errors-spki-list')
	options.add_argument('log-level=3')
	return webdriver.Edge(service=EdgeService(EdgeChromiumDriverManager().install()), options=options)

driver = setup()
driver.maximize_window()
baseurl = "https://indeed.com/" 
driver.get(baseurl)
```

&#x20;

## Step 2: Spidering

Since we have 2 different apps, I am going to cover indeed spider. The reason it is called spider is because it webs out to subpages that are found until x length.&#x20;

```python
def spider(query):
	query = query.replace(' ', '+')
	fullList = getLinks(query, 600)
	g = open('urlLinks.txt','a')
	for q in fullList:
		g.write(q + "\n")
		g.flush()
	g.close()
```

Which sends the query to the link. This request the page with all the links up until specified limit.

```python
def getLinks(query, limit):
	url6 = "https://indeed.com/"
	joboption = "/jobs?q=" + query
	startCount = 0
	fullList = []
	while startCount < limit:
		if startCount == 0:
			driver.get(url6 + joboption)
		else:
			driver.get(url6 + joboption + "&start=" + str(startCount))
		time.sleep(1)
		src = driver.page_source
		newLinks = parseResultPage(src)
		for s in newLinks:
			fullList.append(s.strip("\""))
		startCount += 10
	return fullList
```

Finally, I parse the links from the list of the initial page and write to a file along with the name of the job for later review.

```python
def parseResultPage(src):
	initInd1 = src.index("<td id=\"resultsCol\">")
	src = src[initInd1::]
	initInd2 = src.index('mosaic-zone')
	newSrc = src[initInd2::]
	fullList = []
	while 'href' in newSrc:
		hInd = newSrc.index('href')
		newSrc = newSrc[hInd::]
		hEnd = newSrc.index('>')
		hLink = newSrc[5:hEnd]
		companyInd = 100
		try:
			companyInd = newSrc.index('company')
		except:
			pass
		if companyInd < 10:
			if " " in hLink:
				hLink = hLink.split(" ")[0]
			fullList.append(hLink)
		newSrc = newSrc[hEnd::]
	return fullList
```

### Conclusion

With this we use certain queries to find jobs that fit what we are looking for. Potential upgrade is to find parts of the article to narrow down if it is a good fit based on information found out about people.

## Step 3: Applying

Now we have all the links to do something it is time to try the application. If the user doesn't login to their account it will keep getting a popup and not able to apply to anything, but instead will keep reaching a page&#x20;

```python
def apply(driver , url):
	driver.get(url)
	time.sleep(3)
	try:
		butts = driver.find_element(By.ID, 'indeedApplyButton').click()
	except:
		print("Page is not valid")
		return "NOPE"
	steps = 0
	while steps < 7:
		nexts = driver.find_elements(By.TAG_NAME, 'button')
		for n in nexts:
			if n.accessible_name == 'Continue':
				n.click()
				break
			if n.accessible_name == 'Submit your application':
				n.click()
				steps = 8
				return "FINISHED"
		time.sleep(2)
		steps += 1
	return "MISSING DATA"
```

There are sleep in there to wait for page to be loaded as we don't want it to not load the objects we need, or it is having a set time delay. Also was an issue if you didn't finish the application it would have a popup which I had to work around.

```python
driver.execute_script("window.open('');")
driver.close()
driver.switch_to.window(driver.window_handles[0])
```

## Conclusion

It is a bare minimum application, but it gets what I needed done and plan on expanding on this idea but for now this is the best I need.

## IMPROVEMENTS

I would love the application to do company websites as well because easy apply is just the starting step for a lot.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://codingmace.gitbook.io/masterward/software/work-in-progress/appfiller.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
