I am trying to test CasperJS out, and are scraping a site which has a grid layout like:
|Name |Name |
|Title |Title |
|Image |Image |
|Something |Something |
|----------------------
|Name |Name |
|Title |Title |
|Image |Image |
|Something |Something |
|----------------------
If I wasn't using CasperJS I would retrieve a list of all the contains (4 i this case) and then run a method on each container which could retrieve an object with the wanted properties.
I just seem to have a hard time of doing this in CasperJS. First I tried to return the list of DOM elements in casper.evaluate(function(){....}), but it can't return DOM elements.
Then I tried to make an each loop which would push the wanted objects (4) to an array and return it in an Evalue, but it keeps returning null.
How would one go about doing something like this in CasperJS. Can I somehow return a context of a container to a method, which can return the object to the main evaluate, which can the return the collection of the objects?