You are on page 1of 2

import requests

import pandas as pd
from bs4 import BeautifulSoup
import plotly.express as px
th = "https://www.jobs.id/lowongan-kerja?kata-kunci=part time"
halaman = requests.get(th)
hasil = BeautifulSoup(halaman.content, 'html.parser')
lowkers = hasil.find_all(class_="single-job-ads")

posisi = []
instansi = []
gaji = []

for p in lowkers:
t1 = p.select("h3")
t2 = t1[0] .select ("a")
posisi.append(t2[0] .get_text ())

t1 = p.select ("P")
t2 = t1[0] .select ("a")

try:
instansi.append(t2[0].get_text())
except:
instansi.append("-")
t2 = t1[1].select("span")
try:
xgaji = t2[1].get_text()
except
xgaji = t2[O].get_text()
xgaji = xgaji.replace(".""")

lowker = pd.DataFrame({
"Posisi": posisi,
"instansi": instansi,
"Gaji":gaji
})

fig = px.bar(lowker, x='instansi', y='Gaji')


fig.show()
t1 = p.select("h3")
t2 = t1[O].select("a")
t3 = t2[O].get_text()

t1 = p.select("p")
t2 = t1[O].select("a")
try:
t2 = t2[O].get_text()
except:
t2 = ""
if (t2.find(" ")>=O):
t3 = t3 + " " + t2[O:t2.find(" ")]
posisi.append(t3)

lowker = pd.DataFrame({
"Posisi": posisi,
"Gaji":gaji
})

fig = px.bar(lowker, x='Posisi', y='Gaji')


fig.show()

import requests
import pandas as pd
from bs4 import BeautifulSoup
import plotly.express as px

th = "https://www.jobs.id/lowongan-kerja?kata-kunci=part time"
halaman = requests.get(th)
hasil = BeautifulSoup(halaman.content, 'html.parser')
lowkers = hasil.find_all(class_="single-job-ads")

posisi = []
instansi = []
gaji = []

for p in lowkers:
t1 = p.select("h3")
t2 = t1[0].select("a")
t3 = t2[0].get_text()

t1 = p.select("p")
t2 = t1[0].select("a")
try:
t2 = t2[0].get_text()
except:
t2 = ""
if (t2.find(" ")>=0):
t3 = t3 + " " + t2[0:t2.find(" ")]
posisi.append(t3)
t2 = t1[1].select("span")
try:
xgaji = t2[1].get_text()
except:
xgaji = t2[0].get_text()
xgaji = xgaji.replace(".","")
if (xgaji=="Gaji Dirahasiakan"):
xgaji = 0
gaji.append(xgaji);

lowker = pd.DataFrame({
"Posisi": posisi,
"Gaji":gaji
})

fig = px.bar(lowker, x='Posisi', y='Gaji')


fig.show()

You might also like