Skip to content

Commit

Permalink
Merge pull request #323 from lalalaurentiu/main
Browse files Browse the repository at this point in the history
Fixed Fortech scraper
  • Loading branch information
lalalaurentiu authored Nov 24, 2023
2 parents 7d3f095 + deb36ab commit 8fe34ca
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions sites/fortech.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
import requests
import json
from bs4 import BeautifulSoup
from utils import *

urls = [
'https://www.fortech.ro/job-openings/',
'https://www.fortech.ro/job-openings/page/2/',
]
from scraper.Scraper import Scraper
from utils import (publish, publish_logo, show_jobs)

page = 1
url = f'https://www.fortech.ro/job-openings/page/{page}/'
company = 'FORTECH'

final_jobs = []

for url in urls:
r = requests.get(url)
soup = BeautifulSoup(r.text, 'html.parser')

job_elements = soup.find('div', class_='cards fortech-cards')
scraper = Scraper()
scraper.get_from_url(url)

job_elements = scraper.find('div', class_='cards').find_all(
'div', class_='card-wrapper')

while job_elements:
for job in job_elements:
job_link = job.find('a')
if job_link and 'title' in job_link.attrs:
if job_link:
job_title = job_link['title']
job_url = job_link['href']

job_url = job_link['href']
final_jobs.append(
{
'job_title' : job_title,
'job_link' : job_url,
'remote' : 'remote',
'city' : 'Cluj-Napoca',
'county': 'Cluj',
'country' : 'Romania',
'company' : company
'job_title': job_title,
'job_link': job_url,
'remote': ['Hybrid', 'Remote', 'On-site'],
'country': 'Romania',
'company': company
}
)

for version in [1,4]:
page += 1
url = f'https://www.fortech.ro/job-openings/page/{page}/'
scraper.get_from_url(url)
job_elements = scraper.find('div', class_='cards fortech-cards')

for version in [1, 4]:
publish(version, company, final_jobs, 'Grasum_Key')

publish_logo(company, 'https://www.fortech.ro/wp-content/themes/fresh-fortech/dist/images/logo-blue.png?v=1')
publish_logo(
company, 'https://www.fortech.ro/wp-content/themes/fresh-fortech/dist/images/logo-blue.png?v=1')

print(json.dumps(final_jobs, indent=4))
show_jobs(final_jobs)

0 comments on commit 8fe34ca

Please sign in to comment.