Skip to content

Commit

Permalink
Formatting and check.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhil25803 committed May 14, 2024
1 parent fc153b0 commit 9caa54c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
15 changes: 6 additions & 9 deletions dev-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1615,11 +1615,8 @@ First create an object of class `Dictionary`.
| `.get_word_of_the_day()` | Returns the word of the day. |
| `.word_of_the_day_definition()` | Returns the definition of the word of the day. |

| Methods | Details |
| ---------------- | -------------------------------------------------------------------------------------------- |
| `.get_word_of_the_day()` | Returns the word of the day. |
| `.word_of_the_day_definition()` | Returns the definition of the word of the day.
--------
---

## Wuzzuf

```python
Expand All @@ -1629,7 +1626,7 @@ jobs = wuzzuf.Jobs()

The `Jobs` class provides methods for configuring scraping parameters and fetching job listings:

| Methods | Details |
| --------------------- | --------------------------------------------------------------------------------------------------- |
| `.filter_job()` | Apply filters such as job title, country, city, and range of years of experience. |
| `.fetch_jobs()` | Fetch job listings from the website based on the applied filters, across multiple pages. |
| Methods | Details |
| --------------- | ---------------------------------------------------------------------------------------- |
| `.filter_job()` | Apply filters such as job title, country, city, and range of years of experience. |
| `.fetch_jobs()` | Fetch job listings from the website based on the applied filters, across multiple pages. |
2 changes: 1 addition & 1 deletion src/scrape_up/wuzzuf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .wuzzuf import Jobs

__all__ = ["Jobs"]
__all__ = ["Jobs"]
19 changes: 3 additions & 16 deletions src/scrape_up/wuzzuf/wuzzuf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import requests
from bs4 import BeautifulSoup
from time import sleep
import json


class Jobs:
Expand Down Expand Up @@ -76,7 +75,7 @@ def __fetch_page_jobs(self, page_num):
job_sub_list.append(job)
return job_sub_list
else:
raise ConnectionError(f"Error code: {response.status_code}")
raise None

def fetch_jobs(self, max_page_number=50):
"""
Expand Down Expand Up @@ -117,7 +116,7 @@ def __get_job_company(self, job_data):

def __get_job_location(self, job_data):
data = job_data.find("span", {"class": "css-5wys0k"})
return data.text.strip() if data else "NA"
return data.text.strip() if data else None

def __get_published_time(self, job_data):
return (
Expand All @@ -129,16 +128,4 @@ def __get_job_properties(self, job_data):
job_properties_string = " ,".join(
[prop.text for prop in job_data.find_all("span", {"class": "eoyjyou0"})]
)
return job_properties_string if job_properties_string else "NA"



def main():
scraper = Jobs()
scraper.filter_job(title="software engineer")
jobs = scraper.fetch_jobs(max_page_number=5)
print(jobs)


if __name__ == "__main__":
main()
return job_properties_string if job_properties_string else None

0 comments on commit 9caa54c

Please sign in to comment.