feat: filter for remote jobs only across Canada
Add remote_only config option that appends LinkedIn's f_WT=2 filter param to search URLs. Change location from Toronto to Canada for broader remote job coverage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -46,7 +46,8 @@ scraper:
|
|||||||
- "Infrastructure Engineer"
|
- "Infrastructure Engineer"
|
||||||
- "Cloud Network Engineer"
|
- "Cloud Network Engineer"
|
||||||
- "Systems Engineer"
|
- "Systems Engineer"
|
||||||
location: "Toronto, ON"
|
location: "Canada"
|
||||||
|
remote_only: true
|
||||||
pages_per_keyword: 3
|
pages_per_keyword: 3
|
||||||
delay_between_pages: [3, 6]
|
delay_between_pages: [3, 6]
|
||||||
delay_between_keywords: [5, 10]
|
delay_between_keywords: [5, 10]
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ class LinkedInJobScraper:
|
|||||||
seen_links = set()
|
seen_links = set()
|
||||||
encoded_keyword = quote(keyword)
|
encoded_keyword = quote(keyword)
|
||||||
encoded_location = quote(location)
|
encoded_location = quote(location)
|
||||||
|
remote_only = self.config.get("remote_only", False)
|
||||||
delay_range = self.config.get("delay_between_pages", [3, 6])
|
delay_range = self.config.get("delay_between_pages", [3, 6])
|
||||||
|
|
||||||
for page in range(pages):
|
for page in range(pages):
|
||||||
@@ -93,6 +94,8 @@ class LinkedInJobScraper:
|
|||||||
f"keywords={encoded_keyword}&location={encoded_location}"
|
f"keywords={encoded_keyword}&location={encoded_location}"
|
||||||
f"&start={start_index}"
|
f"&start={start_index}"
|
||||||
)
|
)
|
||||||
|
if remote_only:
|
||||||
|
url += "&f_WT=2"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = self.session.get(url, timeout=15)
|
response = self.session.get(url, timeout=15)
|
||||||
|
|||||||
Reference in New Issue
Block a user