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

Shipping price parsing problem #2

Closed
tomer953 opened this issue Aug 12, 2021 · 2 comments
Closed

Shipping price parsing problem #2

tomer953 opened this issue Aug 12, 2021 · 2 comments

Comments

@tomer953
Copy link
Contributor

Hi,

I think amazon.com (and maybe other domains) updated their shipping price template.

we need to update our extractPrice() function.

Demo product:
https://www.amazon.com/gp/product/B083X4VCLB?pf_rd_r=ZS2V02RVRD05ZWBJYHBS&pf_rd_p=6fc81c8c-2a38-41c6-a68a-f78c79e7253f&pd_rd_r=c18de448-e0e3-4518-ba37-f48304c6cebb&pd_rd_w=hYKXB&pd_rd_wg=iNJx8&ref_=pd_gw_unk

image

this line:

shippingPrice = extractPrice(shipping);

is called with the element:

<span class="a-size-base a-color-secondary">
$33.16 Import Fees Deposit &amp; <b>FREE Shipping</b> to Israel
</span>

leads to a wrong relevant variable:

var relevant = element.childElementCount > 0 ?

since the element.querySelectorAll(':not(.a-text-strike)' not taking the actual shipping price, but the <b>FREE Shipping</b> tag

@yfrans
Copy link
Owner

yfrans commented Aug 15, 2021

I think we can remove the "relevant" and just take the innerHTML.
In the past, they used to write the old price under the same element as the current price so we had to use this method to extract the correct price. I don't see this behavior anymore.
0dcb148

@tomer953
Copy link
Contributor Author

LGTM
thanks

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

No branches or pull requests

2 participants