def _create_job_offers(job_card_tags): job_offers = [] try: for job_card_tag in job_card_tags: title_tag = job_card_tag.find("a", {"data-tn-element": "jobTitle"}) title = title_tag.get_text().strip() company_name = job_card_tag.find("span", { "class": "company" }).get_text().strip() offer_link = "http://ro.indeed.com" + str(title_tag.attrs["href"]) description_page_soup = _get_soup_from_page(offer_link) job_offer = JobOffer(title, company_name, site, offer_link) job_offer.application_link = _get_best_application_link( description_page_soup, offer_link) location_tag = job_card_tag.find("span", {"class": "location"}) job_offer.location = location_tag.get_text().strip( ) if location_tag is not None else None image_tag = description_page_soup.find( "img", {"class": "jobsearch-CompanyAvatar-image"}) job_offer.company_image = image_tag.attrs["src"] if \ image_tag is not None \ else None job_offers.append(job_offer) except Exception as e: shared_service.send_email(e, traceback.format_exc()) return job_offers
def get_job_details(job_offer): try: page = requests.get(job_offer.offer_link) soup = BeautifulSoup(page.content, "html.parser") job_offer.description = _get_job_criteria(soup) + _get_job_description(soup) job_offer.work_type = _get_work_type(soup) except Exception as e: shared_service.send_email(e, traceback.format_exc()) return job_offer
def get_job_details(job_offer): try: soup = _get_soup_from_page(job_offer.offer_link) job_offer.description = str( soup.find( "div", {"class": "jobsearch-jobDescriptionText"})) # scrape html code work_type_tag = soup.findAll( "span", {"class": "jobsearch-JobMetadataHeader-iconLabel"}) job_offer.work_type = work_type_tag[1].get_text().strip() if \ len(work_type_tag) > 1 \ else None except Exception as e: shared_service.send_email(e, traceback.format_exc()) return job_offer
def _create_job_offers(job_card_tags): job_offers = [] try: for job_card_tag in job_card_tags: title_tag = job_card_tag.find("a", {"class": "title dataLayerItemLink"}) title = title_tag.get_text().strip() company_name_tag = job_card_tag.find("h3", {"class": "jobitem-company"}) company_name = company_name_tag.get_text().strip() if \ company_name_tag is not None \ else None offer_link = title_tag.attrs["href"] job_offer = JobOffer(title, company_name, "ejobs", offer_link) job_offer.application_link = _get_application_link(job_card_tag) job_offer.location = job_card_tag.find("span", {"class": "location-text"}).get_text().strip() image_tag = job_card_tag.find("img", {"class": "jobitem-logo-img"}) job_offer.company_image = image_tag.attrs["data-src"] if \ image_tag is not None \ else None job_offers.append(job_offer) except Exception as e: shared_service.send_email(e,traceback.format_exc()) return job_offers
def _create_job_offers(job_rows): job_offers = [] try: for job_row in job_rows: title = job_row.find("span", { "itemprop": "title" }).get_text().strip() company_name = job_row.find("span", { "itemprop": "name" }).get_text().strip() offer_link = "https://www.hipo.ro" + job_row.find( "a", {"class": "job-title"})["href"] job_offer = JobOffer(title, company_name, site, offer_link) job_offer.location = _get_locations(job_row) job_offer.work_type = job_row.find("span", { "itemprop": "employmentType" }).get_text().strip() job_offer.application_link = offer_link job_offers.append(job_offer) except Exception as e: shared_service.send_email(e, traceback.format_exc()) return job_offers