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

New Endpoint for Reviews #10

Open
pyccino opened this issue Dec 1, 2023 · 0 comments
Open

New Endpoint for Reviews #10

pyccino opened this issue Dec 1, 2023 · 0 comments

Comments

@pyccino
Copy link

pyccino commented Dec 1, 2023

Issue Description:

While exploring ways to enhance the efficiency of retrieving Amazon product reviews, I stumbled upon a potential backup solution that involves parsing HTML responses. I believe this could serve as a valuable alternative in scenarios where the program encounters difficulties fetching reviews in the standard way.

URL:
https://www.amazon.it/gp/customer-reviews/widgets/average-customer-review/popover?contextId=dpx&asin=B0C4PTCPXQ

HTML Response Example:

<div class="a-fixed-left-grid"><div class="a-fixed-left-grid-inner" style="padding-left:300px"><div class="a-fixed-left-grid-col a-col-left" style="width:300px;margin-left:-300px;float:left;"><div class="a-icon-row a-spacing-small a-padding-none"><i data-hook="average-stars-rating-anywhere" class="a-icon a-icon-star a-star-5"><span class="a-icon-alt">5 su 5</span></i><span data-hook="acr-average-stars-rating-text" class="a-size-medium a-color-base a-text-beside-button a-text-bold">5 su 5</span></div><div class="a-row a-spacing-medium"><span data-hook="total-review-count" class="a-size-base a-color-secondary totalRatingCount">5 valutazioni globali</span></div>
<table id="histogramTable" class="a-normal a-align-center a-spacing-base">
    <tr data-reftag="" data-reviews-state-param="{&quot;filterByStar&quot;:&quot;five_star&quot;, &quot;pageNumber&quot;:&quot;1&quot;}" aria-label="100% di recensioni hanno 5 stelle" class="a-histogram-row a-align-center">
      <td class="aok-nowrap">
        <span class="a-size-base">
          <a aria-disabled="true" class="a-link-normal 5star" title="100% di recensioni hanno 5 stelle" href="/product-reviews/B0C4PTCPXQ/ref=acr_dpx_hist_5?ie=UTF8&amp;filterByStar=five_star&amp;reviewerType=all_reviews#reviews-filter-bar">
            5 stelle
          </a>
        </span>
        <span class="a-letter-space"></span>
      </td>
      <td class="a-span10">
        <a aria-disabled="true" aria-hidden="true" class="a-link-normal" title="100% di recensioni hanno 5 stelle" href="/product-reviews/B0C4PTCPXQ/ref=acr_dpx_hist_5?ie=UTF8&amp;filterByStar=five_star&amp;reviewerType=all_reviews#reviews-filter-bar">
          <div class="a-meter" role="progressbar" aria-valuenow="100%"><div class="a-meter-bar" style="width: 100%;"></div></div>
        </a>
      </td>
      <td class="a-text-right a-nowrap">
        <span class="a-letter-space"></span>
        <span class="a-size-base">
          <a aria-disabled="true" aria-hidden="true" class="a-link-normal" title="100% di recensioni hanno 5 stelle" href="/product-reviews/B0C4PTCPXQ/ref=acr_dpx_hist_5?ie=UTF8&amp;filterByStar=five_star&amp;reviewerType=all_reviews#reviews-filter-bar">
              100%
          </a>
        </span>
      </td>
    </tr>

Proposed Solution:

Considering the concise nature of the HTML file, parsing it should be a relatively quick and effective method for obtaining reviews. Implementing this as a backup solution can potentially improve the program's robustness.

Additional Notes:

It's worth noting that the HTML structure appears straightforward, making it suitable for parsing. This alternative method could prove particularly useful in situations where retrieving reviews from the standard html presents challenges.

I would appreciate your consideration of this suggestion and would be happy to provide further details or assistance as needed.

An other important note is that ASIN can't be concatenaited. You'll need to do a query for each ASIN.

Thank you.

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

1 participant