Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
237 views
in Technique[技术] by (71.8m points)

javascript - Fetching Price Chart Data from Zillow

I am working on a project for myself to find the best house matching my criterion. I put a python code together to download data from zillow by scraping it using Selenium (Chrome). This will help me to load data in Excel and run some analysis - my usage is personal, time& location limited and legal. Here is a brief description and my question:

Desc: Zillow displays some price charts like 1. I need the data on this curve. It is fetched by a GraphQL script like the following (I obtained by inspecting network activity of the website using Firefox dev tools):

await fetch("https://www.zillow.com/graphql/?zpid=53084803&timePeriod=TEN_YEARS&metricType=LOCAL_HOME_VALUES&forecast=true&operationName=HomeValueChartDataQuery", {
    "credentials": "include",
    "headers": {
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:84.0) Gecko/20100101 Firefox/84.0",
        "Accept": "*/*",
        "Accept-Language": "en-US,en;q=0.5",
        "content-type": "text/plain"
    },
    "referrer": "https://www.zillow.com/homedetails/7317-Vineyard-Dr-Plano-TX-75025/53084803_zpid/",
    "body": "{"query":"query HomeValueChartDataQuery($zpid: ID!, $metricType: HomeValueChartMetricType, $timePeriod: HomeValueChartTimePeriod) {\n  property(zpid: $zpid) {\n    homeValueChartData(metricType: $metricType, timePeriod: $timePeriod) {\n      points {\n        x\n        y\n      }\n      name\n    }\n  }\n}\n","operationName":"HomeValueChartDataQuery","variables":{"zpid":53084803,"timePeriod":"TEN_YEARS","metricType":"LOCAL_HOME_VALUES","forecast":true},"clientVersion":"home-details/6.0.11.0.0.hotfix-01-25-21.373d699"}",
    "method": "POST",
    "mode": "cors"
});
question from:https://stackoverflow.com/questions/65907479/fetching-price-chart-data-from-zillow

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...