-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added codes to extract job description snippet #9
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
A few changes to be made before merging. See code review comments.
Also before submitting the pull request make sure you have pulled the latest upstream.
You should be working of the latest code in the main branch.
Let me know if you have any questions. Thanks!
@@ -19,16 +19,26 @@ def indeed_job_search(): | |||
browser.implicitly_wait(5) | |||
|
|||
search_results = browser.find_elements_by_xpath('//h2/a') | |||
|
|||
search_descriptions=browser.find_elements_by_xpath('//div[@class="summary"]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format code added to match surrounding code. Add whitespace around operators. For example, edit "search_descriptions=browser" to be "search_descriptions = browser"
descriptions=[] | ||
for element in search_descriptions: | ||
job_description=element.text | ||
descriptions.append(job_description) | ||
|
||
file = open("job_search.txt", 'a') | ||
file.write("\n") | ||
|
||
|
||
index=0 | ||
for job_element in search_results: | ||
|
||
job_title = job_element.text | ||
job_link = job_element.get_attribute('href') | ||
|
||
|
||
file.write("%s | link: %s | description: %s \n" %(job_title, job_link, descriptions[index])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you refactor to make this section one for loop instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I will make the changes, and can you tell how to pull the latest upstream? I'm new to open source and don't have much idea on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@btapash Sure, just follow these steps:
add link to upstream in your local repo
git remote add upstream https://github.com/inspirezonetech/JobSearchWebScraping.git
you can confirm the upstream was added by running
git remote -v
pull main branch from the upstream to update your local repo
git pull upstream main
now make your changes on your branch and push the changes to Github
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Any updates? @btapash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some problem with my laptop, it is in service centre for repairing. I can do it after a week or you can assign someone else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay no problem thanks for letting me know. I'll unassign you to leave it open. If its still open when your laptop is fixed you can try again.
No description provided.