Comments (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.
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="{"key":"scrollState"}">{"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.
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)
- Can we get the ISBN number scraped as well? HOT 5
- No support for International stores
- Fix rating on new wishlist
- old price is always n/a HOT 1
- Safety issues HOT 2
- Can't find package on composer HOT 3
- Please add the library to packagist HOT 1
- Ideas on new Wishlist
- Adding Offered By...
- Not working ?! HOT 3
- Amazon wishlist update HOT 5
- null HOT 5
- work with baby and wedding registries
- Previously working wishlists stopped working on June 29 2019 HOT 1
- how to actually use it to give gifts effectivly
- Previously working feeds now only returning null with HTTP code 200 HOT 1
- Wrong charset - UTF8 with tld=de not working
- CSV?
- My ID Returns "null" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-wish-lister.