Adonaizedek
New Member
- Joined
- Nov 13, 2015
- Messages
- 4
I am trying to create code that will navigate careerbuilder with internet explorer and apply for jobs automatically. I am stuck at Applying for the actual job by clicking the button which is input type. The code is below. Also I need to attach my resume which exist on my pc to career builder sometimes which i have no idea to do and havnt seen post related to
1. Navigate to Career Builder Website with Keyword in Text
2. List all the jobs on the worksheet col A
3. Go through all the job link and click to see details of the job
4. Click the Apply button which has the html tag /a as a link
5. Attach Resume on drop down and search where resume is on my PC ****No Idea How to Do*****
6. Click the [Apply Now] button ****Doesnt work. *****
Sub GETALLINKS()
Dim IE As Object
Set IE = CreateObject("internetExplorer.Application")
IE.Visible = True
URL = ""
'========================================='
'Navigate to Job... List all Noc Jobs on sheet1
'========================================='
IE.navigate "http://www.careerbuilder.com/jobseeker/jobs/jobresults.aspx?s_rawwords=noc&s_freeloc=dallas%2Ctx"
Const navOpenInNewTab = &H800
Do
DoEvents
Loop Until IE.readyState = 4
r = 2
Set AllHyperLinks = IE.document.getElementsByTagName("A")
For Each hyper_link In AllHyperLinks
If InStr(hyper_link, "jobdetails.aspx?APath") > 0 Then
Sheet1.Cells(r, "A").Value = hyper_link
'IE.navigate hyper_link, CLng(navOpenInNewTab)
'Application.Wait (Now + TimeValue("0:00:3"))
r = r + 1
End If
Next
'========================================='
'Click to get the details of the first job
'========================================='
' oIE.Visible = True
r = 1
Set AllHyperLinks1 = IE.document.getElementsByTagName("A")
For Each hyper_link1 In AllHyperLinks1
If InStr(hyper_link1, "jobdetails.aspx?APath") > 0 Then
If r = 1 Then hyper_link1.Click
While IE.Busy ' wait for webpage to finish loading
DoEvents
Wend
Do Until IE.readyState = READYSTATE_COMPLETE ' wait for everything to settle down
DoEvents
Loop
Exit For ' jump out of the "for .. next" loop
GoTo AfterLink5:
r = r + 1
End If
Next
AfterLink5:
While IE.Busy
DoEvents
Wend
IE.Visible = True
r = 1
'======================================'
'Click the Apply to Job button
'======================================'
Set AllHyperLinks = IE.document.getElementsByTagName("a")
For Each hyper_link In AllHyperLinks
If InStr(hyper_link, "applyonline/applybegin.aspx?") > 0 Then
If r = 1 Then hyper_link.Click
GoTo AfterLink6:
r = r + 1
End If
Next
AfterLink6:
While IE.Busy
DoEvents
Wend
IE.Visible = True
' Set Links = IE.document.getElementById("Send Application").getElementsByTagName("input")
' Links.Click
Beep
IE.Visible = True
While IE.Busy ' wait for webpage to finish loading
DoEvents
Wend
Do Until IE.readyState = READYSTATE_COMPLETE ' wait for everything to settle down
DoEvents
Loop
'Delay 5
IE.document.getElementById("cbhlApplyFloaty").Click
Beep
1. Navigate to Career Builder Website with Keyword in Text
2. List all the jobs on the worksheet col A
3. Go through all the job link and click to see details of the job
4. Click the Apply button which has the html tag /a as a link
5. Attach Resume on drop down and search where resume is on my PC ****No Idea How to Do*****
6. Click the [Apply Now] button ****Doesnt work. *****
Sub GETALLINKS()
Dim IE As Object
Set IE = CreateObject("internetExplorer.Application")
IE.Visible = True
URL = ""
'========================================='
'Navigate to Job... List all Noc Jobs on sheet1
'========================================='
IE.navigate "http://www.careerbuilder.com/jobseeker/jobs/jobresults.aspx?s_rawwords=noc&s_freeloc=dallas%2Ctx"
Const navOpenInNewTab = &H800
Do
DoEvents
Loop Until IE.readyState = 4
r = 2
Set AllHyperLinks = IE.document.getElementsByTagName("A")
For Each hyper_link In AllHyperLinks
If InStr(hyper_link, "jobdetails.aspx?APath") > 0 Then
Sheet1.Cells(r, "A").Value = hyper_link
'IE.navigate hyper_link, CLng(navOpenInNewTab)
'Application.Wait (Now + TimeValue("0:00:3"))
r = r + 1
End If
Next
'========================================='
'Click to get the details of the first job
'========================================='
' oIE.Visible = True
r = 1
Set AllHyperLinks1 = IE.document.getElementsByTagName("A")
For Each hyper_link1 In AllHyperLinks1
If InStr(hyper_link1, "jobdetails.aspx?APath") > 0 Then
If r = 1 Then hyper_link1.Click
While IE.Busy ' wait for webpage to finish loading
DoEvents
Wend
Do Until IE.readyState = READYSTATE_COMPLETE ' wait for everything to settle down
DoEvents
Loop
Exit For ' jump out of the "for .. next" loop
GoTo AfterLink5:
r = r + 1
End If
Next
AfterLink5:
While IE.Busy
DoEvents
Wend
IE.Visible = True
r = 1
'======================================'
'Click the Apply to Job button
'======================================'
Set AllHyperLinks = IE.document.getElementsByTagName("a")
For Each hyper_link In AllHyperLinks
If InStr(hyper_link, "applyonline/applybegin.aspx?") > 0 Then
If r = 1 Then hyper_link.Click
GoTo AfterLink6:
r = r + 1
End If
Next
AfterLink6:
While IE.Busy
DoEvents
Wend
IE.Visible = True
' Set Links = IE.document.getElementById("Send Application").getElementsByTagName("input")
' Links.Click
Beep
IE.Visible = True
While IE.Busy ' wait for webpage to finish loading
DoEvents
Wend
Do Until IE.readyState = READYSTATE_COMPLETE ' wait for everything to settle down
DoEvents
Loop
'Delay 5
IE.document.getElementById("cbhlApplyFloaty").Click
Beep