python - Alchemy API raise error 404 -


i'm writing python script run alchemy api. tested script on text docs , works well, problem raised when input url. of time alchemy's algorithm response ok it's response error 404. checked failed urls on alchemy's demo , algorithm works (it means url isn't broken).

*i looked in old posts , tried replace in url problematic characters "\n", "\r" "" , none of them worked.

do have suggestions cause error?

update solved problem, used old api 'category' instead of 'taxonomy'. extract category instead of using:

response = alchemy.category('text', input_data)         if response['status'] == 'ok':                                         category_name = response["category"] 

use:

response = alchemy.taxonomy('text', input_data) if response['status'] == 'ok':             category_name = response['taxonomy'][0]['label'] 


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -