added codes to extract job description snippet#9
added codes to extract job description snippet#9btapash wants to merge 1 commit intoinspirezonetech:mainfrom
Conversation
funbeedev
left a comment
There was a problem hiding this comment.
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!
|
|
||
| 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.
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.
Can you refactor to make this section one for loop instead?
There was a problem hiding this comment.
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.
@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.
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.
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.