Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions job-search-web-scraping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]')
Copy link
Member

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]))
Comment on lines +24 to +39
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

@funbeedev funbeedev Oct 21, 2020

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

Copy link
Member

@funbeedev funbeedev Oct 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Any updates? @btapash

Copy link
Contributor Author

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.

Copy link
Member

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.

index=index+1

file.write("%s | link: %s \n" %(job_title, job_link))

browser.close()

Expand Down