drumorgan Posted August 18, 2011 Posted August 18, 2011 The google one is built in and works well. I run a script and I get to maps.google.com with the address of the current record. Now, I need some help getting to zillow with the same address. Fields are individual for street, city, state 1600 Amphitheatre Parkway Mountain View CA comes out like this in the URL http://www.zillow.com/homes/1600-Amphitheatre-Parkway-Mountain-View-CA_rb/ ( I actually prefer not to enter the zip as this is a good zip lookup script if needed) ***************************** The next question is a way to get the square footage data from the zillow site back into my database easier than simply going to zillow, reading it, and then coming back and entering it. That is my real goal right now. Thanks.
Fitch Posted August 18, 2011 Posted August 18, 2011 The address looks pretty simple, just use Substitute to change spaces to dashes, etc., e.g. Substitute( List( street; city; state ) ; [ " " ; "-" ] ; [ P ; "-" ] ) // (P is a paragraph symbol) For the square footage, you could scrape the html, using GetLayoutObjectAttribute ( "yourWebViewer" ; "content" ) ... However, you'll have much more power and flexibility if you use the Zillow API -- you'll need to use a plugin such as ScriptMaster from 360Works to do this.
comment Posted August 18, 2011 Posted August 18, 2011 Perhaps you should also read: http://www.zillow.co...pi/APITerms.htm you'll need to use a plugin I am not sure about that - it seems to work with a GET request.
drumorgan Posted August 19, 2011 Author Posted August 19, 2011 A simple "Open URL" script call with the URL specified as "http://www.zillow.com/homes/" & Substitute( Homes::AddressStreet ; [ " " ; "-" ] ) & "-" & Substitute( Homes::AddressCity ; [ " " ; "-" ] ) & "-" & Homes::AddressState & "_rb/" did the trick. Now, what is the easy way to scrub that page for the square feet again? I've never used an API.
comment Posted August 19, 2011 Posted August 19, 2011 There is no way to scrub that page for the square feet, because it's not on that page. You could possibly scrape it from here: http://www.zillow.com/homedetails/1600-Amphitheatre-Pkwy-Mountain-View-CA-94043/2144291589_zpid assuming you are allowed to do that by their Terms of Use.
drumorgan Posted August 19, 2011 Author Posted August 19, 2011 I know my eyes have a way of going to a page, reading it and finding the info I want. But, does FMPro have that capability for any given page? (We can talk about permission later)
comment Posted August 19, 2011 Posted August 19, 2011 Filemaker has the ability to read the page source. This is the same thing you see when you select 'View Page Source' in your browser. What your eyes see on the rendered page is not necessarily spelled out in the source document. For example, it could be fetched dynamically from elsewhere - and the source contains only directions on how to fetch it.
drumorgan Posted August 19, 2011 Author Posted August 19, 2011 Great. Given the page we are working on (Zillow), what is the step to search the HTML for the specific data? (or any data) Is it simply a script action found in the list? I see <th scope="row">Sqft:</th><td>50</td> in the HTML. Seems like there should be an algorithm to pull the number from a page if they all follow this format.
comment Posted August 19, 2011 Posted August 19, 2011 (edited) It's the same as parsing any other text. You need to select some "anchor" that you believe is both unique to the page and not likely to change, and take it from there, e.g.: Let ( [ anchor = "<th scope=\"row\">Sqft:</th><td>" ; pos = Position ( text ; anchor ; 1 ; 1 ) ; start = pos + Length ( anchor ) ; end = Position ( text ; "</td>" ; start ; 1 ) ] ; Case ( pos ; Middle ( text ; start ; end - start ) ) ) However, this is a "pedestrian" method compared to using the API. Edited August 19, 2011 by comment
Fitch Posted August 19, 2011 Posted August 19, 2011 For the square footage, you could scrape the html, using GetLayoutObjectAttribute ( "yourWebViewer" ; "content" )
Recommended Posts
This topic is 4845 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now