Coder Social home page Coder Social logo

Comments (3)

chris-n-self avatar chris-n-self commented on July 22, 2024 3

I got this working, the "showMoreUrl" uses a field in the url called last evaluated key &lek= to point to the next set of items. I can grab that from the current page with,

$next_page = pq('script[data-a-state=\'{"key":"scrollState"}\']')->html()
preg_match("/\"lastEvaluatedKey\":\"(.*)\"/", $next_page, $next_page_url)
$lek = $next_page_url[1]

The $lek really just work like pages, the items shown on each do not overlap with each other. So (in my local copy of the code) I've just replaced the loop over page_num with,

$lek = ''
do {
      $contents = phpQuery::newDocumentFile("$baseurl/registry/$amazon_id?...&lek=$lek");
      ...
      // get new value of $lek here
} while(!$lek == '');

where I've just appended &lek=$lek onto the end of the url in the phpQuery::newDocumentFile call.

from amazon-wish-lister.

chris-n-self avatar chris-n-self commented on July 22, 2024

I dug through the html of the wishlist page a little bit and found this at the end of the items sections, <script type="a-state" data-a-state="{&quot;key&quot;:&quot;scrollState&quot;}">{"showMoreUrl": it's followed by a URL that if I copy and paste into my browser takes me to the 'second page' of items. Following the chain of pages, when you're at the end of the wishlist that field is missing from the html. I can imagine maybe it's possible to grab that URL and go to the next page to get the next items, repeating until the field is missing. But I don't understand how the phpQuery is working well enough to try it myself, without it taking a while.

from amazon-wish-lister.

blobaugh avatar blobaugh commented on July 22, 2024

I am experiencing the same issue. I have verified that PR #34 does fix the issue for me.

from amazon-wish-lister.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.