node-osmosis
node-osmosis copied to clipboard
Getting data from list
Hi,
here is html sample which I'd like to scrape.
<div class="items">
<div class="item">
<div class="name">John</div>
<img src="john.jpg" />
</div>
<div class="item">
<div class="name">Ana</div>
<img src="ana.jpg" />
</div>
</div>
With my code I keep getting into strange loops.
.get('http://someUrl.com')
.log(console.log)
.find('.name')
.set('name')
...
How would I get this data? Thank you in advance.
PS: If there would be any more tutorials, that would be awesome.
Append .data()
to your code.
...
.data(function (item) {
console.log(item.name);
});
Ok, this sample works. But how I could also get image?