import requests
url = https://www.nseindia.com/get-quotes/equity?symbol=ACC
data = requests.get('https://www.nseindia.com/get-quotes/equity?symbol=ACC'')
print(data)
I’m trying to load data from above url but failed. How to do that? I got a invalid syntax error.
>Solution :
You mean this?
import requests
data = requests.get('https://www.nseindia.com/get-quotes/equity?symbol=ACC')
print(data)
Saying url = https://www.nseindia.com/get-quotes/equity?symbol=ACC is wrong because that is not a variable and has to be a string, plus you don’t even need it. You also have an extra ' behind your url.