China Naming Network - Feng Shui knowledge< - Help: Get weather forecast using python

Help: Get weather forecast using python

# Get temperature, humidity, wind, etc.

WEATHER_URL_A = "/data/sk/%s.html"

# Get weather conditions, maximum/minimum Temperature, etc.

WEATHER_URL_B = "/data/cityinfo/%s.html"

# Get weather data for the next 7 days

WEATHER_URL_C = "/weather/% s.shtml"

%s in the URL refers to the code corresponding to the city. Detailed reference:

blogs.com/toosuo/p/3868004.html

However, some interfaces in this article are no longer available.

Of the three URLs I gave above, the first two directly return json format data; the third returns a page, and you need to extract the desired information from the page.