File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,23 @@ def relocatme_crawler(page):
8
8
all_jobs = []
9
9
for job in jobs :
10
10
job_name = job .find (class_ = "job__title" ).get_text ()
11
- job_title , job_location = job_name .strip ('\n ' ).split ('\n ' )
11
+ job_content = job_name .strip ('\n ' ).split ('\n ' )
12
+ job_title = job_content [0 ]
13
+ try :
14
+ job_location = job_content [1 ]
15
+ except :
16
+ job_location = 'Relocation or remote'
12
17
job_preview = job .find (class_ = "job__preview" ).get_text ()
13
18
job_info = job .find (class_ = "job__info" )
14
19
job_company = job_info .find (class_ = "job__company" ).get_text ().strip ('\n ' )
15
- relocation_info = job_info .find (class_ = 'relocation-package-wrapper' ).find_all ('div' )
16
- relocation_type = relocation_info [0 ].get_text ().strip ('\n ' )
17
- relocation_details = relocation_info [1 ].get_text ().strip ('\n ' ).split ('\n \n \n \n ' )
20
+ try :
21
+ relocation_info = job_info .find (class_ = 'relocation-package-wrapper' ).find_all ('div' )
22
+ relocation_type = relocation_info [0 ].get_text ().strip ('\n ' )
23
+ relocation_details = relocation_info [1 ].get_text ().strip ('\n ' ).split ('\n \n \n \n ' )
24
+ except :
25
+ relocation_type = 'Advanced relocation package'
26
+ relocation_details = 'Unknown'
27
+
18
28
job_tags = job .find (class_ = "job__tags_wrapper" ).get_text ().strip ('\n ' ).split ('\n ' )
19
29
link = 'https://relocate.me/' + job .find (class_ = "job__title" ).find ('a' ).attrs ['href' ]
20
30
try :
You can’t perform that action at this time.
0 commit comments