Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Apply to InfoJobs
#!/usr/bin/env osascript
# Apply to InfoJobs offers.
tell application "Google Chrome" to ¬
tell front window's active tab to ¬
execute javascript ¬
"document.getElementById" & ¬
# Apply to InfoJobs offers.
for OFFER in $(chrome-cli open "$SEARCH" -n > /dev/null; \
sleep 4; chrome-cli source | gawk -v RS='[<>]' '/JSON/' \
| gawk -v FS='?' -v RS='"' '/of-/{print "https:"$1}'); do
chrome-cli open "$OFFER" > /dev/null; sleep 2
PAGE="$(chrome-cli source \
| gawk -v FS='["&]' -v RS='[<>]' -v SITE="$SITE" \
'/Apply/{if ($4~/index/) print SITE$4}')"
[ "$PAGE" ] && chrome-cli open $PAGE; sleep 2
chrome-cli execute "document.getElementById('botonEnviar').click();"
sleep 1; chrome-cli close; chrome-cli close; done; chrome-cli close -w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment