Closed yashwanth-csi closed 2 years ago
@rorydavidson it looks like clients with "User-Agent: Python3" are being blocked from the public Snowstorm instance. Do you have a recommendation here?
Changing line #12 to req.add_header('User-Agent','Python') works
Thank you so much. Its works after changing the line #12.
While accessing the code from python I'm facing below error :
Traceback (most recent call last): File "C:\Users\yvallabhaneni\PycharmProjects\Metaiq_Categories\test.py", line 49, in
getConceptsByString('covid')
File "C:\Users\yvallabhaneni\PycharmProjects\Metaiq_Categories\test.py", line 34, in getConceptsByString
response = urlopen_with_header(url).read()
File "C:\Users\yvallabhaneni\PycharmProjects\Metaiq_Categories\test.py", line 13, in urlopen_with_header
return urlopen(req)
File "C:\Users\yvallabhaneni\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\yvallabhaneni\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 523, in open
response = meth(req, response)
File "C:\Users\yvallabhaneni\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 632, in http_response
response = self.parent.error(
File "C:\Users\yvallabhaneni\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 561, in error
return self._call_chain(args)
File "C:\Users\yvallabhaneni\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 494, in _call_chain
result = func(args)
File "C:\Users\yvallabhaneni\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 423:
Please help me with this.