-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (36 loc) · 1.54 KB
/
Copy pathmain.py
File metadata and controls
49 lines (36 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# main.py
from prompts import ask_choice, ask_multi_states, ask_multi_jobtypes, ask_int
from writers import open_csv_writer
from scrapers.seek_scraper import scrape_seek
from scrapers.indeed_scraper import scrape_indeed
from scrapers.jora_scraper import scrape_jora
def main():
print("=== JOB SCRAPING MACHINE (Integrated System) ===")
platform = ask_choice(
"Mau scraping platform apa?",
choices=["seek", "indeed", "jora"],
allow_all=True
)
keyword = input("\nMasukkan keyword/job title (contoh: Software Engineer): ").strip()
if not keyword:
print("❌ Keyword kosong. Batal.")
return
chosen_states = ask_multi_states() # [] berarti ALL
chosen_job_types = ask_multi_jobtypes() # [] berarti ALL
seek_pages = ask_int("\nMax pages SEEK", 1)
indeed_pages = ask_int("Pages per state INDEED", 1)
jora_pages = ask_int("Max pages JORA", 5)
out = input("\nNama output CSV (default jobs_all_platforms.csv): ").strip() or "jobs_all_platforms.csv"
f, writer = open_csv_writer(out)
try:
if platform in ["all", "seek"]:
scrape_seek(keyword, seek_pages, chosen_states, chosen_job_types, writer)
if platform in ["all", "indeed"]:
scrape_indeed(keyword, indeed_pages, chosen_states, chosen_job_types, writer)
if platform in ["all", "jora"]:
scrape_jora(keyword, jora_pages, chosen_states, chosen_job_types, writer)
finally:
f.close()
print(f"\n✅ Done. Output: {out}")
if __name__ == "__main__":
main()