Skip to content

Commit dbd7a15

Browse files
authored
Merge pull request #1 from SamRB-dev/m2p1
v1.2.1 Minor 2 Patch 1
2 parents 084b035 + 0397b9a commit dbd7a15

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.vscode
22
__pycache__
33
Seekout
4-
geckodriver.exe
4+
geckodriver.exe
5+
**.csv

AutoSeekOut.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
""" Necessary Global Variables """
1414
# Driver Path
15-
DPATH:str = "geckodriver.exe"
15+
DPATH:str = "/home/pentester/Desktop/upwork/Backup/geckodriver"
1616

1717
# Change URL
1818
URL:str = "https://app.seekout.io/project/cf3ec799-9f29-4069-a29c-6d034b69fe59"
@@ -31,13 +31,13 @@
3131
STARTFROM:int = 140
3232

3333
# Change the limit of the Page Iteration. It should be the last page number of the project.
34-
LIMIT:int = 142
34+
LIMIT:int = 141
3535

3636
# Change Title of the project
37-
TITLE = "Intuit"
37+
TITLE:str = "Intuit"
3838

3939
# Change File Name. The script will save the data in one CSV. It has to be cleaned and divided.
40-
FILE = "Intuit.csv"
40+
FILE:str = "Intuit.csv"
4141

4242
#Main Class
4343
class Scrape:
@@ -156,11 +156,29 @@ def Scrape(self):
156156
print(f"Total Candidates: {total}")
157157
print(f"Added: {added}")
158158
self.PAGE += 1
159-
print("-x-" * 40)
159+
print("-x-" * 30)
160160
handler.close()
161161
except Exception as err:
162162
print(err.message)
163+
164+
def Clean(self):
165+
try:
166+
# Reading all lines the raw saved file
167+
main = open(FILE,mode='r')
168+
lines = main.readlines()
169+
main.close()
170+
# Making a clean file
171+
dupstr = ",name,linkedin,role,company,location\n"
172+
cleaned = open(f"{TITLE}-cleaned.csv",'a')
173+
cleaned.write(f"{dupstr}")
174+
for line in lines:
175+
if line != dupstr:
176+
cleaned.write(line)
177+
cleaned.close()
178+
except Exception as err:
179+
print(err)
163180

164181
if __name__ == "__main__":
165182
bot = Scrape()
166183
bot.Scrape()
184+
bot.Clean()

0 commit comments

Comments
 (0)