开发者

A little bit of If statements, some html investigating, and the webbrowser

I have a code that retrieves all the "place names" and all the "addresses" separately in this link:

http://www.yellowpages.ca/search/si-geo/1开发者_开发技巧/sh/Ottawa,+ON

I need to modify my code so that it will only retrieve the placename and address if

<div class="address""> is not found within <div class="listingDetail"">

class="address" is the address of the location, class="listingDetail" is the parent, or container. Some screenshots, please view them for better understanding:

A little bit of If statements, some html investigating, and the webbrowser

A little bit of If statements, some html investigating, and the webbrowser


If you use javascript use:

var addresses = Array.filter( document.getElementsByClassName('listingDetail'), function(listingDetail){  
   return listingDetail.getElementsByClassName('address');  
 });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜