Home » Microsoft Technologies

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:


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:




4 Answers Found


Answer 1

You have " a code", hmmmm? What's stopping you from changing it? Did you write it yourself?



Answer 2

Yes I did. I didnt post it because it uses the HtmlAgilityPack, didnt want to confuse anyone. (see my other thread "Match 2 different string together" for the code). 


Whats stopping me from changing it? 

Im requesting help because I dont know how to go about doing it



Answer 4

Well I figured it out. Since "class=listingTitleLine" (placename) is a preceding sibling of "class=address" (address), all I needed to do was tell Xpath to get the preceding sibling of the address. 







<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure