Skip to content
This repository was archived by the owner on Dec 23, 2018. It is now read-only.

Update reviews.py search for subreview text#32

Open
kevinlondon wants to merge 1 commit intoadamlwgriffiths:masterfrom
kevinlondon:patch-1
Open

Update reviews.py search for subreview text#32
kevinlondon wants to merge 1 commit intoadamlwgriffiths:masterfrom
kevinlondon:patch-1

Conversation

@kevinlondon
Copy link

The hook for the text has changed from an a tag to a span.

The hook for the text has changed from an `a` tag to a `span`.
@adamlwgriffiths
Copy link
Owner

Because of Amazon's flip-flopping between styles, I think it's a good idea to leave the old <a> check in.
Could you make it so that the new code is inside a if not tag check, or something equivalent (tag = get<a> or get<span> or get ....).

@adamlwgriffiths
Copy link
Owner

adamlwgriffiths commented Nov 4, 2017

Lol, happy belated birthday

Copy link

@gardart gardart left a comment

Choose a reason for hiding this comment

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

alternative method without using a or span

@property
def text(self):
tag = self.soup.find('a', class_=re.compile('review-text'))
tag = self.soup.find('span', class_=re.compile('review-text'))
Copy link

Choose a reason for hiding this comment

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

what about this method:
tag = self.soup.find(class_=re.compile('review-text'))

@adamlwgriffiths
Copy link
Owner

If it works for the majority of pages, then sure.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants