3

I am working in get wheather conditions from a web. http://trestlebikepark.com/

When I use the Inspect Element Function from Chrome or Firefox I find the div class with the text I need (34F).

<div class="overlayWeather">
                <div class="title">Current</div>
                <div class="icon"><span class="climacon sun"></span></div>
                <div class="temperature">34 °F</div>
                <div class="conditions">Sunny</div>
            </div>

But in the Source Code the content is empty.

        <div class="currentStatusOverlay">
            <div class="overlayWeather">
                <div class="title">Current</div>
                <div class="icon"><span class="climacon"></span></div>
                <div class="temperature"></div>
                <div class="conditions"></div>
            </div>
        </div>

How I can get this texts?

I tried

Document doc = Jsoup.connect(url).get();

            Elements div = doc.select("div.temperature");
            String temp = div.text();

I receive empty results

I understand than the table is populated after the page is loaded, but I cant find information on how get this values in an android textView

2

1 Answer 1

1

Another way to do this instead of Jsoup: Send a Http request to

https://secure.winterparkresort.com/JSON/RtpJsonServices.asmx/getTrestleConditions?callback=null

This will give you some JSON like:

null({"iconClass":"sun","Temperature":34,"Conditions":"Sunny","openLifts":0,"openTrails":0});

And you have the information you want.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.