Udemy Lecture on using Python to search the web( trying to get the code to pull data from the internet ) What am I doing wrong?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Asked
Viewed
7 times
import re
import urllib.request
#https://www.weather-forecast.com/locations/Dublin/forecasts/latest
city =input(“Enter your city:”)
url = “https://www.weather-forecast.com/locations/”+ city +”forecasts/latest”
data = urllib.request.urlopen(url).read()
data1 = data.decode(“utf-8”)
print(data1)
Sean is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
default
Leave an answer