How to get temperature from web site?

Hi;
I find a lot of projects to deal with temperature sensors and display the result on LCD, but here I want to get the temperature from weather sites then send the results to another place by ethernet cable.... any help, please?

And how is that related to Arduino? An Arduino is probably one of the worst choices for such a task.

I agree with @pylon an Arduino does not sound like a good choice for the problem as you describe it.
A Pi might be better.

To get the temperature from a weather site you need to get your processor to browse to that site then parse the HTML of the page that contains the reading and extract it. The problem with this approach is that any changes to the weather webpage format may mess up your parsing.

You can get a feel for what is involved by using a browser on a PC and going to one of the weather sites then get the browser to show the source HTML for the page (most browsers will let you do this). If you can see the temperature you want then you need to figure out code to read through the HTML you are seeing and get that number.

Rather than looking at weather sites in general you might be best to search for a site or sites that explicitly expect people to be automatically extracting weather data from them. I don't know if these sites exist but if they do they will probably either tag the readings to make them easy to extract or they will provide the data in some kind of feed.

There are indeed sites that give you weather data in a more parseable form. NOAA runs one that gives airport data, here's my local airport: NOAA's National Weather Service

Note that if you try that in a browser, there's a bunch of extraneous data. Use curl to see the raw xml.

Weather underground has an api that will do this by city: http://api.wunderground.com/api/

But as mentioned, do this on a Pi.

wildbill:
There are indeed sites that give you weather data in a more parseable form.

NOAA has a JSON API to get easily parsed data for a specific latitude/longitude point. I've used this for an AppInventor2/Android App (essentially a Raspberry Pi class machine), but it's probably within the capability of ESP8266/NodeMCU.

Sample request looks like this: https://forecast.weather.gov/MapClick.php?lat=37.89&lon=-97.22&FcstType=json

The algorithm would be something like, send request, get text response (about 5k bytes, but variable size which is problematic on Arduino), look for "currentobservation" field, look for "Temp" sub-field, display value associated "Temp" key.

I expect this only works for points in the U.S., but there may be similar services elsewhere.

Thanks guys for your responding, now do you suggest another method to do that instead of Arduino?

Hayderamily:
Thanks guys for your responding, now do you suggest another method to do that instead of Arduino?

As noted in several posts above a Raspberry Pi can do this sort of thing easily. In Python3 this code prints current temperature using the NOAA link identified in post #4:

import urllib.request, json 

with urllib.request.urlopen("https://forecast.weather.gov/MapClick.php?lat=37.89&lon=-97.22&FcstType=json") as url:
    data = json.loads(url.read().decode())
    print(data.get('currentobservation').get('Temp'))

do what this guy did

sorry for the poor links, not sure why the link feature is adding all the extra bits.

get weather

[iurl=Weather forecast for heating control - Project Guidance - Arduino Forum

https://forum.arduino.cc/index.php?topic=511066.0

this test ?
link

https://forum.arduino.cc/index.php?topic=511066.0

test :

linktest

test #2 :
linktest2

test #3 :

linktest#3

I'd also consider if it does need to output over an ethernet cable. Could it send it over a wireless network and let a router/access point to the wired to wireless step? If so, then a Pi Zero is a very cheap way of doing it.

What is the overall aim of your project?

Hi
I have a remote station and want to get the weather there, some of my friends use the normal temperature sensor but the reading is not accurate, so my manager ask if it is possible to get the temp from websites not from sensors and send it back to my location using ethernet.
I have some knowledge in Arduino so if there a tutorial about that. thank you very much

Hayderamily:
Hi
I have a remote station and want to get the weather there, some of my friends use the normal temperature sensor but the reading is not accurate, so my manager ask if it is possible to get the temp from websites not from sensors and send it back to my location using ethernet.
I have some knowledge in Arduino so if there a tutorial about that. thank you very much

You should read the answers above.
If you can find a website that gives weather readings for the location you want and presents them in a manner that you can decode then yes you can do it. It might be unlikely though that the websites are taking readings near where you want and since temperatures, winspeeds etc. can all vary quite a lot over relatively small distances you might be better using your own sensors.

Hayderamily:
Hi
I have a remote station and want to get the weather there, some of my friends use the normal temperature sensor but the reading is not accurate, . . .

Perhaps it might be more sensible to figure out why these temperature readings are not accurate and correct that problem.

MrMark:
Perhaps it might be more sensible to figure out why these temperature readings are not accurate and correct that problem.

Unfortunatly, the temperature on two sides of the same soda bottle will be different.
put a soda bottle with some water on your window, not in the sun.
in a few hours one side will condense, proving that the temperature on one side is warm enough to have less than 100% humidity, while the other side temperature is below the dew point (over 100%)
a sensor in the shade will be different than in the sun
a sensor near a thermal mass (road, rock, wall, pond, pool, etc) will be very heavily influenced by the local conditions.
The entire man-caused-globalwarming hoax was debunked when they found the measurements were faulty and manipulated to make it 'fit' since each year since 1999 has been (reportedly) warmer than the last, the temperature is now 120 F ! (49C).... at least if you do the math the media tells you.
for weather temperature sensing, you need to use the louvered box, painted white and have quote a few in an area.
as a point of fact, wind has no effect on temperature. it can MOVE warmer or colder air over the sensors, but wind alone has no effect on temperature.