This repository was archived by the owner on Feb 7, 2024. It is now read-only.
Fix the issue with multi-line comments#8
Open
ArmanKabiri wants to merge 2 commits into
Open
Conversation
sshinoobi
suggested changes
Aug 16, 2020
| @@ -0,0 +1,128 @@ | |||
| { | |||
| products_count = 0 | ||
|
|
||
| start_urls = [ | ||
| # 'https://www.digikala.com/main/apparel/', |
| start_urls = [ | ||
| # 'https://www.digikala.com/main/apparel/', | ||
| 'http://digikala.com/', | ||
| # 'https://digikala.com/main/book-and-media/' |
| neg = [x.strip() for x in neg_raw] | ||
| txt = comment_selector.css('p::text').extract_first() | ||
|
|
||
| ##########MODIFIED BY ARMAN############ |
Owner
There was a problem hiding this comment.
You should delete this comment. People can use git blame or other editors' tools like annotation to see your contribution. Furthermore, your contributions would be always presented in repo's history.
| for txt_itr in txt_list: | ||
| txt += txt_itr.strip()+"\n" | ||
| txt = txt.strip() if txt is not None else None | ||
| ######################################## |
| txt_list = comment_selector.css('p::text').extract() | ||
| txt = "" | ||
| for txt_itr in txt_list: | ||
| txt += txt_itr.strip()+"\n" |
Owner
There was a problem hiding this comment.
I think it makes sense to concatenate those lines with single whitespace instead of "\n".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request, fixes the issue of the code with multi-line comments. The original code only extracts the first line of each comment. Now it is able to extract the multi-line comments completely.