Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Market_Value Attributes Update #32

Merged
merged 1 commit into from
Oct 10, 2021
Merged

Conversation

DonFloriano27
Copy link
Contributor

Attributes dict is additionally filled with market values (current and highest)

Attributes dict is additionally filled with market values (current and highest)
@@ -73,6 +73,8 @@ def parse_details(self, response, base):
attributes['contract_expires'] = self.safe_strip(response.xpath("//span[text()='Contract expires:']/following::span[1]/text()").get())
attributes['day_of_last_contract_extension'] = response.xpath("//span[text()='Date of last contract extension:']/following::span[1]/text()").get()
attributes['outfitter'] = response.xpath("//span[text()='Outfitter:']/following::span[1]/text()").get()
attributes['current_market_value'] = response.xpath("//div[@class='marktwertentwicklung']//div[@class='zeile-oben']//div[@class='right-td']//a/text()").get().strip()
Copy link
Owner

Choose a reason for hiding this comment

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

This looks great @DonFloriano27!
Just one tiny detail: would you mind using the self.safe_strip method to do the stripping instead of calling .strip() on the string? This will make a little bit more robust and it wont' fail in case if the scraped value is a null.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants