shahin
Active Member
As I was told that If i manipulate string on the javascript encrypted html stuff, then i can parse certain things i would like to have. This site i'm dealing with now contains javascript wrapped html elements. I would like to parse the phone numbers from that page as it is easy to prepare the ground comparatively. I didn't use query string as I noticed that without using it the desired page can be located with the url. I was trying like this:
Btw, FYC the search city is: Saskatoon
The visible elements within which phone numbers are stored:
Btw, FYC the search city is: Saskatoon
Code:
Sub test()
Dim http As New XMLHTTP60
Dim str As Variant
With http
.Open "GET", "https://www.saskatoonrealtors.ca/web/SRAR/Find_A_REALTOR/SRAR/Find_an_Agent/Find_A_REALTOR_2.aspx?hkey=96d9da44-1d30-4c12-8c70-b3c495fe0610", False
.setRequestHeader "Content-Type", "text/html; charset=utf-8"
.send
End With
On Error Resume Next
str = Split(http.responseText, "<td class=""officeCell"">")
y = UBound(str)
For i = 1 To y
Cells(x, 1) = Split(Split(str(i), "<div class=""ng-binding"">Phone:")(1), "</")(0)
Next i
End Sub
The visible elements within which phone numbers are stored:
Code:
<td class="officeCell">
<h4 ng-click="selectItem(element)" class="ng-binding">2 Percent Realty Inc.</h4>
<div ng-bind-html="element.FullAddress | newlines" class="ng-binding">700 2010 11th Ave Regina, SK S4P 0J3 CANADA</div>
<div class="ng-binding">Phone: (639) 739-0909</div>
<div ng-show="element.Fax" class="ng-binding">Fax: (888) 123-4567</div>
<div ng-show="element.BrokerName" class="ng-binding">Broker: Morris Tkachuk</div>
<div ng-show="element.EmailAddress"><a ng-href="mailto:info@2percentrealty.ca" class="ng-binding" href="mailto:info@2percentrealty.ca">info@2percentrealty.ca</a></div>
<a ng-show="element.Website" ng-href="http://" target="_blank" href="http://" class="ng-hide">Website</a>
</td>
Last edited: